]> granicus.if.org Git - php/commitdiff
fix crash bug introduced by last commit
authorThies C. Arntzen <thies@php.net>
Sun, 14 Apr 2002 18:27:27 +0000 (18:27 +0000)
committerThies C. Arntzen <thies@php.net>
Sun, 14 Apr 2002 18:27:27 +0000 (18:27 +0000)
ext/oci8/oci8.c

index 83d466e84d2cc4aec6db93933e247871c75f1b83..d9b1ff75be68939b875eec27319699a8876ccd3d 100644 (file)
@@ -697,7 +697,9 @@ _oci_bind_post_exec(void *data TSRMLS_DC)
 
        if (bind->indicator == -1) { /* NULL */
                zval *val = bind->zval;
-               *Z_STRVAL_P(val) = '\0'; /* XXX avoid warning in debug mode */
+               if (Z_TYPE_P(val) == IS_STRING && (Z_STRVAL_P(val) != empty_string)) {
+                       *Z_STRVAL_P(val) = '\0'; /* XXX avoid warning in debug mode */
+               }
                zval_dtor(val);
                ZVAL_NULL(val);
        } else if (Z_TYPE_P(bind->zval) == IS_STRING && (Z_STRVAL_P(bind->zval) != empty_string)) {