com php-src: fix condition: main/fopen_wrappers.c

From: Date: Thu, 19 Mar 2015 21:33:15 +0000
Subject: com php-src: fix condition: main/fopen_wrappers.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-85655@lists.php.net to get a copy of this message
Commit: 9bcd64fd83487382e94199560cd809b152d03c97 Author: Anatol Belski <ab@php.net> Thu, 19 Mar 2015 13:40:49 +0100 Parents: 49fdb8a91df1a910736bafd92fe820a81ea5a795 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9bcd64fd83487382e94199560cd809b152d03c97 Log: fix condition Changed paths: M main/fopen_wrappers.c Diff: diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 396b0c5..d8a8330 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -586,7 +586,7 @@ PHPAPI zend_string *php_resolve_path(const char *filename, int filename_length, const char *exec_fname = exec_filename->val; size_t exec_fname_length = exec_filename->len; - while ((--exec_fname_length >= 0) && !IS_SLASH(exec_fname[exec_fname_length])); + while ((--exec_fname_length < SIZE_MAX) && !IS_SLASH(exec_fname[exec_fname_length])); if (exec_fname_length > 0 && exec_fname_length + 1 + filename_length + 1 < MAXPATHLEN) { memcpy(trypath, exec_fname, exec_fname_length + 1); @@ -664,7 +664,7 @@ PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const c const char *exec_fname = exec_filename->val; size_t exec_fname_length = exec_filename->len; - while ((--exec_fname_length >= 0) && !IS_SLASH(exec_fname[exec_fname_length])); + while ((--exec_fname_length < SIZE_MAX) && !IS_SLASH(exec_fname[exec_fname_length])); if ((exec_fname && exec_fname[0] == '[') || exec_fname_length <= 0) { /* [no active file] or no path */ pathbuf = estrdup(path);

« previous php.cvs (#85655) next »