Explorar o código

Fall back to arbitrary PATH_MAX upper bound

Stefan Siegl %!s(int64=11) %!d(string=hai) anos
pai
achega
0fed780320
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      php_v8js_macros.h

+ 8 - 0
php_v8js_macros.h

@@ -42,6 +42,14 @@ extern "C" {
 #include <vector>
 #include <mutex>
 
+#ifndef PATH_MAX
+/* Some platforms (Windows among others) don't have a PATH_MAX, for the moment
+ * just assume an arbitrary upper bound of 4096 chars.
+ * Anyways we should fix (get rid of) the code that uses PATH_MAX as it doesn't
+ * even check for buffer overflows.  FIXME */
+#define PATH_MAX 4096
+#endif
+
 /* V8Js Version */
 #define V8JS_VERSION "0.1.5"