]> granicus.if.org Git - php/commitdiff
Fixed possible memory corruption.
authorIlia Alshanetsky <iliaa@php.net>
Tue, 21 Jun 2005 00:12:35 +0000 (00:12 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 21 Jun 2005 00:12:35 +0000 (00:12 +0000)
sapi/cli/php_cli.c

index a0b9cfaaa26fe53d9bc390aac52b463b581dd300..6fe4922e733e3f41b0b33f49236aeeb346d0a124 100644 (file)
@@ -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