From a462e687dc8d9802c4f712b5c5f825d629027809 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 21 Jun 2005 00:12:35 +0000 Subject: Fixed possible memory corruption. --- sapi/cli/php_cli.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sapi/cli/php_cli.c') 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 -- cgit v1.2.1