summaryrefslogtreecommitdiff
path: root/sapi/cli/php_cli.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2005-06-21 00:12:35 +0000
committerIlia Alshanetsky <iliaa@php.net>2005-06-21 00:12:35 +0000
commita462e687dc8d9802c4f712b5c5f825d629027809 (patch)
tree1daeaaf3177bd047959faa5cb9cd54ac893b1cfe /sapi/cli/php_cli.c
parent79d649e17323f4fa6bd234f4cdf609a99e91435a (diff)
downloadphp-git-a462e687dc8d9802c4f712b5c5f825d629027809.tar.gz
Fixed possible memory corruption.
Diffstat (limited to 'sapi/cli/php_cli.c')
-rw-r--r--sapi/cli/php_cli.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index a0b9cfaaa2..6fe4922e73 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -213,6 +213,9 @@ static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC)
size_t ret;
#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+ if (!str_length) {
+ return 0;
+ }
php_last_char = str[str_length-1];
#endif