From: foobar Date: Wed, 15 Jan 2003 15:53:34 +0000 (+0000) Subject: MFH: handle ERANGE from strtol properly X-Git-Tag: PHP_4_3_before_13561_fix~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=55f12ed0bbcea7ae73913810cf0881907b174839;p=php MFH: handle ERANGE from strtol properly --- diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index 684b42c793..8f235a92c9 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -231,7 +231,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);