]> granicus.if.org Git - php/commitdiff
fix possible usage of uninitialized variable
authorAntony Dovgal <tony2001@php.net>
Sun, 18 Dec 2005 12:48:22 +0000 (12:48 +0000)
committerAntony Dovgal <tony2001@php.net>
Sun, 18 Dec 2005 12:48:22 +0000 (12:48 +0000)
ext/sysvmsg/sysvmsg.c

index affa6e20add6f98fdf28e598caa3eb5662c68bd6..0404ff80c1b3735346a94c535d4a62e7f9ccde56 100644 (file)
@@ -341,8 +341,9 @@ PHP_FUNCTION(msg_receive)
                        if (!php_var_unserialize(&tmp, &p, p + result, &var_hash TSRMLS_CC)) {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "message corrupted");
                                RETVAL_FALSE;
+                       } else {
+                               REPLACE_ZVAL_VALUE(&out_message, tmp, 1);
                        }
-                       REPLACE_ZVAL_VALUE(&out_message, tmp, 0);
                        FREE_ZVAL(tmp);
                        PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
                } else {