]> 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:44:29 +0000 (00:44 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 9 Nov 2004 00:44:29 +0000 (00:44 +0000)
ext/cpdf/cpdf.c

index 4c872d7cbd1386422d0480eb3cdfc5b3359c93d3..594f1ca6f74ca240e6558ae10ffa44092002b7e6 100644 (file)
@@ -1286,6 +1286,10 @@ PHP_FUNCTION(cpdf_setdash)
        convert_to_long_ex(arg2);
        convert_to_long_ex(arg3);
 
+       if (!pdf->currentMemStream) {
+               RETURN_FALSE;
+       }
+
        snprintf(buffer, BUFFERLEN, "[%d %d] 0", (int) Z_LVAL_PP(arg2), (int) Z_LVAL_PP(arg3));
        cpdf_setdash(pdf, buffer);