Skip to content

Commit

Permalink
Fix incorrect memory write (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
dedmen authored Oct 22, 2023
1 parent 5d9d484 commit a382d83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PboFolder.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "PboFolder.hpp"
#include "PboFolder.hpp"


#include <Shlwapi.h>
Expand Down Expand Up @@ -1073,7 +1073,7 @@ HRESULT PboFolder::SetNameOf(HWND hwnd, LPCITEMIDLIST pidl, LPCOLESTR pszName, S
//#TODO OOM check
PboPidl::CreatePidlAt(newPidl, newFilePath, qp->type);
// last cbSize is 0
uint16_t* afterCB = (uint16_t*)(((uintptr_t)qp) + pidlSize);
uint16_t* afterCB = reinterpret_cast<uint16_t*>(reinterpret_cast<uintptr_t>(newPidl) + pidlSize);
*afterCB = 0;

*ppidlOut = (LPITEMIDLIST)newPidl;
Expand Down

0 comments on commit a382d83

Please sign in to comment.