From: Rainer Schaaf Date: Wed, 21 Feb 2001 23:30:21 +0000 (+0000) Subject: When using pdf_get_buffer() and doing a correct cleanup by calling pdf_delete() X-Git-Tag: php-4.0.5RC1~198 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28ed45fa72cfc938375808b2617d2124f0fcb480;p=php When using pdf_get_buffer() and doing a correct cleanup by calling pdf_delete() this always resulted in a coredump (after everything was finished, so only visible in the logfile). So it seems to be neccesary to copy the contents of the result of get_buffer, to avoid this coredump. --- diff --git a/ext/pdf/pdf.c b/ext/pdf/pdf.c index c8bc728301..7519bc43b0 100644 --- a/ext/pdf/pdf.c +++ b/ext/pdf/pdf.c @@ -2176,7 +2176,7 @@ PHP_FUNCTION(pdf_get_buffer) { buffer = PDF_get_buffer(pdf, &size); - RETURN_STRINGL((char *)buffer, size, 0); + RETURN_STRINGL((char *)buffer, size, 1); } /* }}} */