mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
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
This commit is contained in:
parent
b60b4683f6
commit
f6c8007a29
2 changed files with 6 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue