]> granicus.if.org Git - php/commitdiff
MFH: Fixed crash inside cpdf_setdash() if called before page init.
authorIlia Alshanetsky <iliaa@php.net>
Tue, 9 Nov 2004 00:45:39 +0000 (00:45 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 9 Nov 2004 00:45:39 +0000 (00:45 +0000)
ext/cpdf/cpdf.c

index 88655ff1d1e7aba0b05a29e4fc7b98550921e6c0..77072830b19f14b306b324d48d8113e518e7aa42 100644 (file)
@@ -1563,7 +1563,9 @@ PHP_FUNCTION(cpdf_setdash)
                php_error(E_WARNING, "%s(): Unable to find identifier %d", get_active_function_name(TSRMLS_C), id);
                RETURN_FALSE;
        }
-
+       if (!pdf->currentMemStream) {
+               RETURN_FALSE;
+       }
        snprintf(buffer, BUFFERLEN, "[%d %d] 0", (int) Z_LVAL_P(arg2), (int) Z_LVAL_P(arg3));
        cpdf_setdash(pdf, buffer);