From: Ben Noordhuis Date: Sun, 18 Mar 2012 01:02:48 +0000 (+0100) Subject: q3map2: bump MAX_OS_PATH to 4096 X-Git-Tag: xonotic-v0.7.0~16^2~6^2~2^2^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f961a54;p=xonotic%2Fnetradiant.git 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. --- diff --git a/tools/quake3/common/cmdlib.h b/tools/quake3/common/cmdlib.h index e7b555b4..3fb98feb 100644 --- a/tools/quake3/common/cmdlib.h +++ b/tools/quake3/common/cmdlib.h @@ -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...