stijnsanders / TMongoWire

Delphi MongoDB driver
MIT License
102 stars 37 forks source link

GUID buffer overflow #18

Closed brandonhamilton closed 10 years ago

brandonhamilton commented 10 years ago

When a GUID is encountered in the save/load procedures of TBSONDocument, a buffer overflow results in an access violation.

This seems to be caused by the fact the in the TGUID object is aliased to an array of 12 bytes, however the StringToGUID call writes 16 bytes into the memory location.

stijnsanders commented 10 years ago

Great find! Thank you. I've done 'absolute o' there in an attempt to save some space on the stack.