]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
q3map2: bump MAX_OS_PATH to 4096
authorBen Noordhuis <info@bnoordhuis.nl>
Sun, 18 Mar 2012 01:02:48 +0000 (02:02 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Sun, 18 Mar 2012 01:17:09 +0000 (02:17 +0100)
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.

tools/quake3/common/cmdlib.h

index e7b555b40b989028b5f4c5a74fbf0a13e3a988b2..3fb98febc98457d9438a089882a41f937dfa0f6d 100644 (file)
@@ -53,7 +53,7 @@
 #endif
 
 
-#define MAX_OS_PATH     1024
+#define MAX_OS_PATH     4096
 #define MEM_BLOCKSIZE 4096
 
 // the dec offsetof macro doesnt work very well...