q3map2: bump MAX_OS_PATH to 4096

Fixes a "buffer overflow detected" abort when compiled with _FORTIFY_SOURCE=1.

The realpath(3) function in glibc checks if the destination buffer is large
enough to hold up to PATH_MAX characters and aborts if that is not the case.
PATH_MAX doesn't have to be defined so assume that it's equal to 4096.

We should really be using pathconf(_PC_PATH_MAX) instead of a hard-coded value
but that means we can no longer use static buffers to hold paths.
This commit is contained in:
Ben Noordhuis 2012-03-18 02:02:48 +01:00
parent 3a959349ac
commit f961a547ff
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@
#endif #endif
#define MAX_OS_PATH 1024 #define MAX_OS_PATH 4096
#define MEM_BLOCKSIZE 4096 #define MEM_BLOCKSIZE 4096
// the dec offsetof macro doesnt work very well... // the dec offsetof macro doesnt work very well...