CodexLabsLLC / Colosseum

Open source simulator for autonomous robotics built on Unreal Engine with support for Unity
https://codexlabsllc.github.io/Colosseum/
Other
390 stars 122 forks source link

Potential Buffer Overflow #79

Open tay10r opened 7 months ago

tay10r commented 7 months ago

https://github.com/CodexLabsLLC/Colosseum/blob/2383b0adfc674d34e68cb05ef163ca1c00479352/AirLib/src/common/common_utils/FileSystem.cpp#L105

The third parameter expresses the buffer being larger than it actually is, since the size of wchar_t is greater than 1.

The function documentation is here.

https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamea

The docs mention that the third parameter is the size of the buffer in terms of TCHARS. Which means that it is more of an element count, than a byte count. I believe it should be set to MAX_PATH.