com php-src: fix buffer overflow: sapi/cli/ps_title.c
[email protected] (Anatol Belski)
| Newsgroups | php.cvs |
|---|---|
| Message-ID | <[email protected]> |
Commit: 2ec54af8df76483a77681e050f93ea17bd0905ec Author: Anatol Belski <[email protected]> Mon, 3 Apr 2017 14:22:23 +0200 Parents: fe46a7da78f037fe032f27c9b65667c675a6dd8d Branches: PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2ec54af8df76483a77681e050f93ea17bd0905ec Log: fix buffer overflow Changed paths: M sapi/cli/ps_title.c Diff: diff --git a/sapi/cli/ps_title.c b/sapi/cli/ps_title.c index c7cfd2a..303115f 100644 --- a/sapi/cli/ps_title.c +++ b/sapi/cli/ps_title.c @@ -411,8 +411,7 @@ int get_ps_title(int *displen, const char** string) ps_buffer_cur_len = ps_buffer_cur_len > sizeof(ps_buffer)-1 ? sizeof(ps_buffer)-1 : ps_buffer_cur_len; - memmove(ps_buffer, tmp, ps_buffer_size); - ps_buffer[ps_buffer_cur_len] = '\0'; + memmove(ps_buffer, tmp, ps_buffer_cur_len); free(tmp); } #endif