From: Sascha Schumann Date: Sun, 12 Jan 2003 13:05:32 +0000 (+0000) Subject: handle ERANGE from strtol properly X-Git-Tag: PHP_5_0_dev_before_13561_fix~296 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0b8401bf271eb02f4741064df55ee853edeb2594;p=php handle ERANGE from strtol properly --- diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index af6c1dbf1d..011ec1f770 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -239,7 +239,12 @@ PS_OPEN_FUNC(files) 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);