From: Ilia Alshanetsky Date: Tue, 9 Nov 2004 00:44:12 +0000 (+0000) Subject: Fixed crash inside cpdf_setdash() if called before page init. X-Git-Tag: RELEASE_0_2~724 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=500690f235d3f032bac7f56c2566629c65cd0335;p=php 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);