From: foobar Date: Sat, 7 Apr 2001 21:46:43 +0000 (+0000) Subject: ws pollution removed. X-Git-Tag: php-4.0.6RC1~462 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=176f5847bec69abbea0a2f9896d432988a5fe192;p=php ws pollution removed. --- diff --git a/ext/standard/file.c b/ext/standard/file.c index e2062405b5..79e42f8a74 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -906,15 +906,17 @@ PHP_FUNCTION(fgets) convert_to_long_ex(arg2); len = (*arg2)->value.lval; - if (len < 0) { + + if (len < 0) { php_error(E_WARNING, "length parameter to fgets() may not be negative"); RETURN_FALSE; - } + } if (type == le_socket) { issock=1; socketd=*(int*)what; } + buf = emalloc(sizeof(char) * (len + 1)); /* needed because recv doesnt put a null at the end*/ memset(buf,0,len+1);