diff options
author | Anatol Belski <ab@php.net> | 2016-12-22 14:56:47 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2016-12-22 14:56:47 +0100 |
commit | 758af77e9d1c3c6e5aea365bc0d35c385278ad5a (patch) | |
tree | 31a297b9da316030aaacb5ab4382f57ba3e46cca /TSRM/tsrm_win32.c | |
parent | afb6ca2566691a673b7e638ffd7e3181e21d80a3 (diff) | |
download | php-git-758af77e9d1c3c6e5aea365bc0d35c385278ad5a.tar.gz |
Path handling related refactorings
Primarily related to the path handling datatypes, to avoid unnecessary
casts, where possible. Also some rework to avoid code dup. Probably
more places are to go, even not path related, primarily to have less
casts and unsigned integers where possible. That way, we've not only
less warnings and casts, but are also safer with regard to the
integer overflows. OFC it's not a panacea, but still significantly
reduces the vulnerability potential.
Diffstat (limited to 'TSRM/tsrm_win32.c')
-rw-r--r-- | TSRM/tsrm_win32.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index 7fa38198de..ac9d667788 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -296,14 +296,14 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode) if (CWDG(realpath_cache_size_limit)) { t = time(0); - bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t); + bucket = realpath_cache_lookup(pathname, strlen(pathname), t); if(bucket == NULL && real_path == NULL) { /* We used the pathname directly. Call tsrm_realpath */ /* so that entry is created in realpath cache */ real_path = (char *)malloc(MAXPATHLEN); if(tsrm_realpath(pathname, real_path) != NULL) { pathname = real_path; - bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t); + bucket = realpath_cache_lookup(pathname, strlen(pathname), t); PHP_WIN32_IOUTIL_REINIT_W(pathname); } } |