]> granicus.if.org Git - php/commitdiff
MFH: handle ERANGE from strtol properly
authorfoobar <sniper@php.net>
Wed, 15 Jan 2003 15:53:34 +0000 (15:53 +0000)
committerfoobar <sniper@php.net>
Wed, 15 Jan 2003 15:53:34 +0000 (15:53 +0000)
ext/session/mod_files.c

index 684b42c79356948d45eef40e781d4f90e35a3ad7..8f235a92c971ce551e6d6331f8ab54fc42316b54 100644 (file)
@@ -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);