From 4593089bdc3e371b9e818a80d77d3ab9ad730f24 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 2 Nov 2023 14:42:28 +0100 Subject: [PATCH] Debugger: Check return value Coverity complains about not checking the return value of f.open() Coverity-Id: 1359453 Change-Id: I9e6b7f5d3ab6ec58e99131e8a0d84d8f17863fed Reviewed-by: Christian Stenger --- src/plugins/debugger/watchhandler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 4a016c80527..42f2d8f54d0 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -2477,7 +2477,8 @@ void WatchModel::showEditValue(const WatchItem *item) QString fileName; ts >> width >> height >> nbytes >> imformat >> fileName; QFile f(fileName); - f.open(QIODevice::ReadOnly); + const bool didFileOpen = f.open(QIODevice::ReadOnly); + QTC_ASSERT(didFileOpen, return); ba = f.readAll(); bits = (uchar*)ba.data(); nbytes = width * height;