mirror of
https://github.com/php/php-src.git
synced 2024-11-28 20:34:29 +08:00
Do not silently truncate
This commit is contained in:
parent
4c5d71917e
commit
b1bb6f1735
@ -55,13 +55,15 @@ PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int
|
||||
php_stream_wrapper *wrapper = NULL;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
strlcpy(filenamecopy, filename, MAXPATHLEN);
|
||||
filename=(char *)&filenamecopy;
|
||||
|
||||
if (!filename) {
|
||||
return 0; /* path must be provided */
|
||||
}
|
||||
|
||||
if (strlcpy(filenamecopy, filename, MAXPATHLEN)>=MAXPATHLEN) {
|
||||
return 0;
|
||||
}
|
||||
filename=(char *)&filenamecopy;
|
||||
|
||||
if (fopen_mode) {
|
||||
if (fopen_mode[0] == 'r') {
|
||||
mode = CHECKUID_DISALLOW_FILE_NOT_EXISTS;
|
||||
|
Loading…
Reference in New Issue
Block a user