Kaydet (Commit) f6c8007a authored tarafından Zackery Spytz's avatar Zackery Spytz Kaydeden (comit) Miss Islington (bot)

bpo-34770: Fix a possible null pointer dereference in pyshellext.cpp (GH-9497)



The GlobalLock() call in UpdateDropDescription() was not checked for
failure.



https://bugs.python.org/issue34770
üst b60b4683
Fix a possible null pointer dereference in pyshellext.cpp.
......@@ -172,6 +172,11 @@ private:
return E_FAIL;
}
auto dd = (DROPDESCRIPTION*)GlobalLock(medium.hGlobal);
if (!dd) {
OutputDebugString(L"PyShellExt::UpdateDropDescription - failed to lock DROPDESCRIPTION hGlobal");
ReleaseStgMedium(&medium);
return E_FAIL;
}
StringCchCopy(dd->szMessage, sizeof(dd->szMessage) / sizeof(dd->szMessage[0]), DRAG_MESSAGE);
StringCchCopy(dd->szInsert, sizeof(dd->szInsert) / sizeof(dd->szInsert[0]), PathFindFileNameW(target));
dd->type = DROPIMAGE_MOVE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment