mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
phar: Avoid string duplication just for error message, use truncation formatting string (#20229)
This commit is contained in:
@@ -4315,10 +4315,7 @@ PHP_METHOD(Phar, extractTo)
|
||||
}
|
||||
|
||||
if (ZSTR_LEN(path_to) >= MAXPATHLEN) {
|
||||
char *tmp = estrndup(ZSTR_VAL(path_to), 50);
|
||||
/* truncate for error message */
|
||||
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Cannot extract to \"%s...\", destination directory is too long for filesystem", tmp);
|
||||
efree(tmp);
|
||||
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Cannot extract to \"%.50s...\", destination directory is too long for filesystem", ZSTR_VAL(path_to));
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user