sniper Wed Jan 15 10:53:35 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/ext/session mod_files.c
Log:
MFH: handle ERANGE from strtol properly
Index: php4/ext/session/mod_files.c
diff -u php4/ext/session/mod_files.c:1.83.2.2 php4/ext/session/mod_files.c:1.83.2.3
--- php4/ext/session/mod_files.c:1.83.2.2 Tue Dec 31 11:35:19 2002
+++ php4/ext/session/mod_files.c Wed Jan 15 10:53:34 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mod_files.c,v 1.83.2.2 2002/12/31 16:35:19 sebastian Exp $ */
+/* $Id: mod_files.c,v 1.83.2.3 2003/01/15 15:53:34 sniper Exp $ */
#include "php.h"
@@ -231,7 +231,12 @@
data->fd = -1;
if ((p = strchr(save_path, ';'))) {
+ errno = 0;
data->dirdepth = (size_t) strtol(save_path, NULL, 10);
+ if (errno == ERANGE) {
+ efree(data);
+ return FAILURE;
+ }
save_path = p + 1;
}
data->basedir_len = strlen(save_path);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php