]> granicus.if.org Git - php/commitdiff
- Fix crash bug on NetBSD and OpenBSD. MAXPATHLEN didn't get defined
authorAndi Gutmans <andi@php.net>
Thu, 7 Sep 2000 15:31:29 +0000 (15:31 +0000)
committerAndi Gutmans <andi@php.net>
Thu, 7 Sep 2000 15:31:29 +0000 (15:31 +0000)
  correctly and caused a stack overrun. This was *hard* to debug.

TSRM/configure.in
TSRM/tsrm_config_common.h
TSRM/tsrm_virtual_cwd.c

index 2b4f81908baf86fa8f6eb7e6b0c21999c9b5e01f..da5cb2953ccd00fb6eb4cd8457f1d99d402d5b9d 100644 (file)
@@ -22,7 +22,10 @@ dnl TSRM_PTHREAD
 AC_CHECK_HEADERS(
 utime.h \
 dirent.h \
-stdarg.h
+stdarg.h \
+alloca.h \
+unistd.h \
+limits.h
 )
 
 AC_DEFINE(ZTS,1,[ ])
index f54911779270985643e65af16cac5cbd64dd6547..8b80f801212bca32310645351fca3bcfd460bbe4 100644 (file)
@@ -7,6 +7,7 @@
 
 #ifndef TSRM_WIN32
 # include "tsrm_config.h"
+# include <sys/param.h>
 #else
 # include "tsrm_config.w32.h"
 #endif
 #include <malloc.h>
 #endif
 
+#if HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#ifndef MAXPATHLEN
+# ifdef PATH_MAX
+#  define MAXPATHLEN PATH_MAX
+# else
+#  define MAXPATHLEN 256
+# endif
+#endif
+
 #if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2))
 # define tsrm_do_alloca(p) alloca(p)
 # define tsrm_free_alloca(p)
index e19a8b2513db7bbd9acdce563e8a63ad5d6dc950..facfdfce0414ca3510398f4752e8d942fe0454da 100644 (file)
 #include "tsrm_virtual_cwd.h"
 #include "tsrm_strtok_r.h"
 
-
-/* Are we doing enough to detect this? */
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 256
-#endif
-
 #ifdef TSRM_WIN32
 #include <io.h>
 #endif