#20368 [NEW]: Gd 2.0.4 (and possibly previous ones)

From: Date: Mon, 11 Nov 2002 20:46:22 +0000
Subject: #20368 [NEW]: Gd 2.0.4 (and possibly previous ones)
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-24618@lists.php.net to get a copy of this message
From: einar@grep.no Operating system: Linux PHP version: 4.2.2 PHP Bug Type: GD related Bug description: Gd 2.0.4 (and possibly previous ones) GD 2.0.4's gd_io header uses gd_free instead of free in its gdIOctx structure.. This affect phproot/ext/gd/gd.c and phproot/ext/gd/gd_ctx.c.. A mere 5 replacements must be done... The following terribly simple patch can be applied, if anyone's lazy.. :P diff -Naur php-4.2.3/ext/gd/gd.c php-4.2.3-gd2-2.0.4/ext/gd/gd.c --- php-4.2.3/ext/gd/gd.c 2002-09-03 15:09:29.000000000 +0200 +++ php-4.2.3-gd2-2.0.4/ext/gd/gd.c 2002-11-11 21:35:30.000000000 +0100 @@ -1011,10 +1011,10 @@ io_ctx = gdNewDynamicCtx (8, data); if (io_ctx) { if (getmbi(gdGetC, io_ctx) == 0 && skipheader(gdGetC, io_ctx) == 0 ) { - io_ctx->free(io_ctx); + io_ctx->gd_free(io_ctx); return PHP_GDIMG_TYPE_WBM; } else - io_ctx->free(io_ctx); + io_ctx->gd_free(io_ctx); } } #endif @@ -1206,7 +1206,7 @@ } else { im = (*ioctx_func_p)(io_ctx); } - io_ctx->free(io_ctx); + io_ctx->gd_free(io_ctx); #endif } else { if (image_type == PHP_GDIMG_TYPE_GD2PART) { diff -Naur php-4.2.3/ext/gd/gd_ctx.c php-4.2.3-gd2-2.0.4/ext/gd/gd_ctx.c --- php-4.2.3/ext/gd/gd_ctx.c 2001-08-05 18:21:29.000000000 +0200 +++ php-4.2.3-gd2-2.0.4/ext/gd/gd_ctx.c 2002-11-11 21:35:37.000000000 +0100 @@ -67,7 +67,7 @@ ctx = emalloc(sizeof(gdIOCtx)); ctx->putC = _php_image_output_putc; ctx->putBuf = _php_image_output_putbuf; - ctx->free = _php_image_output_ctxfree; + ctx->gd_free = _php_image_output_ctxfree; #if APACHE && defined(CHARSET_EBCDIC) /* XXX this is unlikely to work any more thies@thieso.net */ @@ -95,7 +95,7 @@ break; } - ctx->free(ctx); + ctx->gd_free(ctx); if(fp) { fflush(fp); -- Edit bug report at http://bugs.php.net/?id=20368&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=20368&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=20368&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=20368&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=20368&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=20368&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=20368&r=support Expected behavior: http://bugs.php.net/fix.php?id=20368&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=20368&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=20368&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=20368&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20368&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=20368&r=dst IIS Stability: http://bugs.php.net/fix.php?id=20368&r=isapi

« previous php.bugs (#24618) next »