Do not silently truncate

This commit is contained in:
Stefan Esser 2004-12-01 22:37:33 +00:00
parent 4c5d71917e
commit b1bb6f1735

View File

@ -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;