]> granicus.if.org Git - php/commitdiff
MFB: Return empty string when recv() does not fetch any data
authorIlia Alshanetsky <iliaa@php.net>
Tue, 3 Feb 2009 19:23:12 +0000 (19:23 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 3 Feb 2009 19:23:12 +0000 (19:23 +0000)
ext/sockets/sockets.c

index 86be02eb5c246ae7b881878b93e5554db77d6318..59f7b2b83ffb737bbc4232d279a30b0f31e66a2f 100644 (file)
@@ -1036,6 +1036,9 @@ PHP_FUNCTION(socket_read)
 
                efree(tmpbuf);
                RETURN_FALSE;
+       } else if (!retval) {
+               efree(tmpbuf);
+               RETURN_EMPTY_STRING();
        }
 
        tmpbuf = erealloc(tmpbuf, retval + 1);