]> granicus.if.org Git - php/commitdiff
handle ERANGE from strtol properly
authorSascha Schumann <sas@php.net>
Sun, 12 Jan 2003 13:05:32 +0000 (13:05 +0000)
committerSascha Schumann <sas@php.net>
Sun, 12 Jan 2003 13:05:32 +0000 (13:05 +0000)
ext/session/mod_files.c

index af6c1dbf1db023b6326179d010978c241167a1e2..011ec1f770e281bbecbe2eeb227e8f7a02a3b99c 100644 (file)
@@ -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);