mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
MFB:Adjust condition
This commit is contained in:
parent
91aa9e2bf9
commit
f18a2ff04c
2 changed files with 3 additions and 3 deletions
|
@ -636,7 +636,7 @@ PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const c
|
|||
*end = '\0';
|
||||
end++;
|
||||
}
|
||||
if (snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename) > MAXPATHLEN) {
|
||||
if (snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename) >= MAXPATHLEN) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s/%s path was truncated to %d", ptr, filename, MAXPATHLEN);
|
||||
}
|
||||
|
||||
|
|
|
@ -1289,7 +1289,7 @@ not_relative_path:
|
|||
/* getcwd() will return always return [DRIVE_LETTER]:/) on windows. */
|
||||
*(cwd+3) = '\0';
|
||||
|
||||
if (snprintf(trypath, MAXPATHLEN, "%s%s", cwd, filename) > MAXPATHLEN) {
|
||||
if (snprintf(trypath, MAXPATHLEN, "%s%s", cwd, filename) >= MAXPATHLEN) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s/%s path was truncated to %d", cwd, filename, MAXPATHLEN);
|
||||
}
|
||||
|
||||
|
@ -1343,7 +1343,7 @@ not_relative_path:
|
|||
if (*ptr == '\0') {
|
||||
goto stream_skip;
|
||||
}
|
||||
if (snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename) > MAXPATHLEN) {
|
||||
if (snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename) >= MAXPATHLEN) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s/%s path was truncated to %d", ptr, filename, MAXPATHLEN);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue