From: Ilia Alshanetsky Date: Tue, 9 Nov 2004 00:45:39 +0000 (+0000) Subject: MFH: Fixed crash inside cpdf_setdash() if called before page init. X-Git-Tag: php-4.3.10RC1~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f38730cf92fae322b6df8e5065b9c0ea7ca755a;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 88655ff1d1..77072830b1 100644 --- a/ext/cpdf/cpdf.c +++ b/ext/cpdf/cpdf.c @@ -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);