diff options
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2011-06-03 21:14:55 -0500 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2011-06-03 21:14:55 -0500 |
commit | 9dad5e37aef295b4ef8dea39392b652deebc9261 (patch) | |
tree | 0ece5ac42e882b8060bf591e4146fbfea4a46d5c | |
parent | adde7b5c1e5f9c5c89aa697aa46d886db5be8562 (diff) | |
download | libpng-9dad5e37aef295b4ef8dea39392b652deebc9261.tar.gz |
[master] Pass "" instead of '\0' to png_default_error() in png_err().
This mistake was introduced in libpng-1.2.20beta01.
-rw-r--r-- | ANNOUNCE | 6 | ||||
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | pngerror.c | 9 |
3 files changed, 14 insertions, 5 deletions
@@ -1,5 +1,5 @@ -Libpng 1.4.8beta01 - May 2, 2011 +Libpng 1.4.8beta01 - June 4, 2011 This is not intended to be a public release. It will be replaced within a few weeks by a public version or by another test version. @@ -26,10 +26,12 @@ Other information: Changes since the last public release (1.4.7): -version 1.4.8beta01 [May 2, 2011] +version 1.4.8beta01 [June 4, 2011] Undef "_ALL_SOURCE" for AIX, to prevent "jmpbuf" from being redefined. Copied png_debug macros from pngpriv.h into pngtest.c and removed "#include pngpriv.h" from pngtest.c, to avoid setting a bad example. + Pass "" instead of '\0' to png_default_error() in png_err(). This mistake + was introduced in libpng-1.2.20beta01. Send comments/corrections/commendations to glennrp at users.sourceforge.net or to png-mng-implement at lists.sf.net (subscription required; visit @@ -2794,10 +2794,12 @@ version 1.4.7rc01 [April 9, 2011] version 1.4.7 [April 9, 2011] Disabled PNG_PEDANTIC_WARNINGS for all MSC versions as in libpng-1.4.5. -version 1.4.8beta01 [May 2, 2011] +version 1.4.8beta01 [June 4, 2011] Undef "_ALL_SOURCE" for AIX, to prevent "jmpbuf" from being redefined. Copied png_debug macros from pngpriv.h into pngtest.c and removed "#include pngpriv.h" from pngtest.c, to avoid setting a bad example. + Pass "" instead of '\0' to png_default_error() in png_err(). This mistake + was introduced in libpng-1.2.20beta01. Send comments/corrections/commendations to glennrp at users.sourceforge.net or to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngerror.c b/pngerror.c index c196b11ce..9798fb712 100644 --- a/pngerror.c +++ b/pngerror.c @@ -87,12 +87,17 @@ png_error(png_structp png_ptr, png_const_charp error_message) void PNGAPI png_err(png_structp png_ptr) { + /* Prior to 1.4.8 the error_fn received a NULL pointer, expressed + * erroneously as '\0', instead of the empty string "". This was + * apparently an error, introduced in libpng-1.2.20, and png_default_error + * will crash in this case. + */ if (png_ptr != NULL && png_ptr->error_fn != NULL) - (*(png_ptr->error_fn))(png_ptr, '\0'); + (*(png_ptr->error_fn))(png_ptr, ""); /* If the custom handler doesn't exist, or if it returns, use the default handler, which will not return. */ - png_default_error(png_ptr, '\0'); + png_default_error(png_ptr, ""); } #endif /* PNG_ERROR_TEXT_SUPPORTED */ |