summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIvan Komissarov <ABBAPOH@gmail.com>2018-10-20 17:34:54 +0200
committerIvan Komissarov <ABBAPOH@gmail.com>2018-10-20 20:41:15 +0000
commit5d61fd8c22b569b3127491e8e42bd9e646e3144a (patch)
treed313ed9e7100c68f1a33df6011a8525a67dc0bd3 /src
parentcea2b5510c28d1057018007d65589fecee62b0d8 (diff)
qfilesystemengine: add missed Q_CHECK_PTR
There might be dereferencing of a potential null pointer Task-number: QTBUG-71156 Change-Id: I202d314d001917a2de0500caf762d2b54ff517cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index 74081b4ffa..a796fd005a 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -204,10 +204,12 @@ GlobalSid::GlobalSid()
::GetTokenInformation(token, TokenUser, 0, 0, &retsize);
if (retsize) {
void *tokenBuffer = malloc(retsize);
+ Q_CHECK_PTR(tokenBuffer);
if (::GetTokenInformation(token, TokenUser, tokenBuffer, retsize, &retsize)) {
PSID tokenSid = reinterpret_cast<PTOKEN_USER>(tokenBuffer)->User.Sid;
DWORD sidLen = ::GetLengthSid(tokenSid);
currentUserSID = reinterpret_cast<PSID>(malloc(sidLen));
+ Q_CHECK_PTR(currentUserSID);
if (::CopySid(sidLen, currentUserSID, tokenSid))
BuildTrusteeWithSid(&currentUserTrusteeW, currentUserSID);
}
@@ -294,6 +296,7 @@ static QString readSymLink(const QFileSystemEntry &link)
if (handle != INVALID_HANDLE_VALUE) {
DWORD bufsize = MAXIMUM_REPARSE_DATA_BUFFER_SIZE;
REPARSE_DATA_BUFFER *rdb = (REPARSE_DATA_BUFFER*)malloc(bufsize);
+ Q_CHECK_PTR(rdb);
DWORD retsize = 0;
if (::DeviceIoControl(handle, FSCTL_GET_REPARSE_POINT, 0, 0, rdb, bufsize, &retsize, 0)) {
if (rdb->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {