From 176f5847bec69abbea0a2f9896d432988a5fe192 Mon Sep 17 00:00:00 2001 From: foobar Date: Sat, 7 Apr 2001 21:46:43 +0000 Subject: [PATCH] ws pollution removed. --- ext/standard/file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); -- 2.50.1