News for hackers. Stuff that matters.
Re:Microsoft_craziness.h (2018) by pierrebai on Wednesday November 24, 2021 @02:58PM (#29334387)
That only works if someone does not race and modify the content of that registry key between the two function calls. And that, my friend, is how buffer overflow exploits are born.

Don't poke beyond your end. Don't poke using a value that was returned by a function you don't control. The code shown does both. Such quality, it Jonathan Blow.

Re:Microsoft_craziness.h (2018) by ploxiln on Wednesday November 24, 2021 @03:07PM (#29334493)
Yeah, this function has a few surprising bits of sloppyness ... but:

> NOTE(Kalinovcic): I have translated the original implementation to C

Another point, this is a build-time tool: some assumptions of good-faith input are reasonable and necessary. If an attacker can modify paths to visual studio components in your registry, you have bigger problems (just running the attacker's code directly regardless of safe string handling).