com php-src: Ensure target is \0 terminated: win32/ioutil.c

From: Date: Thu, 04 Oct 2018 17:17:58 +0000
Subject: com php-src: Ensure target is \0 terminated: win32/ioutil.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-103357@lists.php.net to get a copy of this message
Commit: 40979277c0bf17d83272e42ffb26c3c0dc38f913 Author: Anatol Belski <ab@php.net> Thu, 4 Oct 2018 19:17:22 +0200 Parents: f48ee1ff58da5cb2aadf617b6f0c34cd2a7a973c Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=40979277c0bf17d83272e42ffb26c3c0dc38f913 Log: Ensure target is \0 terminated Changed paths: M win32/ioutil.c Diff: diff --git a/win32/ioutil.c b/win32/ioutil.c index 5d729da..b3ef507 100644 --- a/win32/ioutil.c +++ b/win32/ioutil.c @@ -1084,7 +1084,8 @@ static ssize_t php_win32_ioutil_readlink_int(HANDLE h, wchar_t *buf, size_t buf_ return -1; } - memcpy(buf, reparse_target, (reparse_target_len + 1)*sizeof(wchar_t)); + memcpy(buf, reparse_target, reparse_target_len*sizeof(wchar_t)); + buf[reparse_target_len] = L'\0'; return reparse_target_len; }/*}}}*/

« previous php.cvs (#103357) next »