summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexWhiter <a.whiter@yandex.ru>2018-04-07 17:01:59 (GMT)
committerAlexWhiter <a.whiter@yandex.ru>2018-04-07 17:01:59 (GMT)
commit1b4f672f32a07317ed1b4903b7c5fec4f5db4d66 (patch)
tree22ea9b609f7390aef464593a8af4cbbfb35f72d7 /src
parent833bfaa509c338d9458b3b549194290e78eb7345 (diff)
downloadcv2pdb-1b4f672f32a07317ed1b4903b7c5fec4f5db4d66.zip
cv2pdb-1b4f672f32a07317ed1b4903b7c5fec4f5db4d66.tar.gz
cv2pdb-1b4f672f32a07317ed1b4903b7c5fec4f5db4d66.tar.bz2
Cleanup of RSDS block after allocation.
Diffstat (limited to 'src')
-rw-r--r--src/cv2pdb.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cv2pdb.cpp b/src/cv2pdb.cpp
index 9b7edbf..0562278 100644
--- a/src/cv2pdb.cpp
+++ b/src/cv2pdb.cpp
@@ -167,10 +167,10 @@ bool CV2PDB::openPDB(const TCHAR* pdbname, const TCHAR* pdbref)
#endif
rsdsLen = 24 + strlen(pdbnameA) + 1; // sizeof(OMFSignatureRSDS) without name
- // Growing the RSDS block to the closest 16-byte boundary.
- if (rsdsLen & 0xF)
- rsdsLen = (rsdsLen | 0xF) + 1;
+ // Growing the RSDS block to the closest 16-byte boundary to align the debug directory.
+ rsdsLen = (rsdsLen + 0xf) & ~0xf;
rsds = (OMFSignatureRSDS *) new char[rsdsLen];
+ memset(rsds, 0, rsdslen);
memcpy (rsds->Signature, "RSDS", 4);
pdb->QuerySignature2(&rsds->guid);
rsds->age = pdb->QueryAge();