Browse Source

httpserver: Guard against null uploaded files in destructor

Fix Coverity CID 652499 by checking the QTemporaryFile pointer
before accessing it. Avoids a potential null dereference when
cleaning up uploaded files.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.1.0
Robin Getz 4 weeks ago
parent
commit
b2550624e2
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 3
      httpserver/httprequest.cpp

3
httpserver/httprequest.cpp

@ -544,6 +544,9 @@ HttpRequest::~HttpRequest() @@ -544,6 +544,9 @@ HttpRequest::~HttpRequest()
foreach(QByteArray key, uploadedFiles.keys())
{
QTemporaryFile* file=uploadedFiles.value(key);
if (!file) {
continue;
}
if (file->isOpen())
{
file->close();

Loading…
Cancel
Save