diff --git a/NEWS b/NEWS index c21acef7a05..10196b5cc9f 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,7 @@ PHP NEWS inherited final). (ilutov) . Fixed NULL arithmetic during system program execution on Windows. (cmb, nielsdos) + . Fixed potential OOB when checking for trailing spaces on Windows. (cmb) - DOM: . Fixed bug GH-17397 (Assertion failure ext/dom/php_dom.c). (nielsdos) diff --git a/win32/winutil.c b/win32/winutil.c index e09944d131b..35cc0fc4e2e 100644 --- a/win32/winutil.c +++ b/win32/winutil.c @@ -56,7 +56,7 @@ PHP_WINUTIL_API void php_win32_error_msg_free(char *msg) int php_win32_check_trailing_space(const char * path, const size_t path_len) {/*{{{*/ - if (path_len > MAXPATHLEN - 1) { + if (path_len == 0 || path_len > MAXPATHLEN - 1) { return 1; } if (path) {