]> 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:22:55 +0000 (19:22 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 3 Feb 2009 19:22:55 +0000 (19:22 +0000)
ext/sockets/sockets.c

index fbec34b379807e4605aa3a4018fd0619ce4e0cb0..2bf6cb3876fc6841ee1ba4b9116b7e8c3cdc5378 100644 (file)
@@ -1046,6 +1046,9 @@ PHP_FUNCTION(socket_read)
 
                efree(tmpbuf);
                RETURN_FALSE;
+       } else if (!retval) {
+               efree(tmpbuf);
+               RETURN_EMPTY_STRING();
        }
 
        tmpbuf = erealloc(tmpbuf, retval + 1);