From: Ilia Alshanetsky Date: Tue, 9 Nov 2004 00:44:29 +0000 (+0000) Subject: MFH: Fixed crash inside cpdf_setdash() if called before page init. X-Git-Tag: php-5.0.3RC1~83 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0ffe2f1093956a43aa2fac32a2df77902bdfce0;p=php MFH: Fixed crash inside cpdf_setdash() if called before page init. --- diff --git a/ext/cpdf/cpdf.c b/ext/cpdf/cpdf.c index 4c872d7cbd..594f1ca6f7 100644 --- a/ext/cpdf/cpdf.c +++ b/ext/cpdf/cpdf.c @@ -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);