com php-src: fix buffer overflow: sapi/cli/ps_title.c
| From: | Anatol Belski | Date: | Mon, 03 Apr 2017 12:22:23 +0000 |
| Subject: | com php-src: fix buffer overflow: sapi/cli/ps_title.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-97470@lists.php.net to get a copy of this message | ||
Commit: 2ec54af8df76483a77681e050f93ea17bd0905ec
Author: Anatol Belski <ab@php.net> 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