News for hackers. Stuff that matters.
Re:What it takes to pass a file path to a Windows API in C++ by mappu on Sunday September 24, 2023 @09:20AM (#37632865)
MAX_PATH is a #define. So its value is baked in to old binaries.

In RAM-constrained world of the past, you would stack-allocate `char buff[MAX_PATH]` and do all your strcpy/strspn in there with no problems.

Now, if that app receives a long path into a too short buffer, it will instantly stack overflow and may cause exploitable problems.

There are no comments on this comment yet.