[libpng12] Avoid potentially dereferencing NULL info_ptr in png_info_init_3().

This commit is contained in:
Glenn Randers-Pehrson 2015-07-30 16:30:47 -05:00
parent 8601d28e1c
commit e5371d48f7
3 changed files with 9 additions and 5 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.2.54beta01 - July 13, 2015 Libpng 1.2.54beta01 - July 30, 2015
This is not intended to be a public release. It will be replaced 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. within a few weeks by a public version or by another test version.
@ -43,13 +43,14 @@ Other information:
Changes since the last public release (1.2.53): Changes since the last public release (1.2.53):
version 1.2.54beta01 [July 13, 2015] version 1.2.54beta01 [July 30, 2015]
Fix typecast in a png_debug2() statement in png_set_text_2() to Fix typecast in a png_debug2() statement in png_set_text_2() to
avoid a compiler warning in PNG_DEBUG builds. avoid a compiler warning in PNG_DEBUG builds.
Fixed printf formats in pngtest.c to avoid compiler warnings and a Fixed printf formats in pngtest.c to avoid compiler warnings and a
Coverity warning in PNG_DEBUG builds. Coverity warning in PNG_DEBUG builds.
Avoid Coverity issue 80858 (REVERSE NULL) in pngtest.c PNG_DEBUG builds. Avoid Coverity issue 80858 (REVERSE NULL) in pngtest.c PNG_DEBUG builds.
Removed WRITE_WEIGHTED_FILTERED code. Removed WRITE_WEIGHTED_FILTERED code.
Avoid potentially dereferencing NULL info_ptr in png_info_init_3().
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -2858,13 +2858,14 @@ version 1.2.53rc02 [February 21, 2015]
versions 1.0.63 and 1.2.53 [February 26, 2015] versions 1.0.63 and 1.2.53 [February 26, 2015]
No changes. No changes.
version 1.2.54beta01 [July 13, 2015] version 1.2.54beta01 [July 30, 2015]
Fixed typecast in a png_debug2() statement in png_set_text_2() to Fixed typecast in a png_debug2() statement in png_set_text_2() to
avoid a compiler warning in PNG_DEBUG builds. avoid a compiler warning in PNG_DEBUG builds.
Fixed printf formats in pngtest.c to avoid compiler warnings and a Fixed printf formats in pngtest.c to avoid compiler warnings and a
Coverity warning in PNG_DEBUG builds. Coverity warning in PNG_DEBUG builds.
Avoid Coverity issue 80858 (REVERSE NULL) in pngtest.c PNG_DEBUG builds. Avoid Coverity issue 80858 (REVERSE NULL) in pngtest.c PNG_DEBUG builds.
Removed WRITE_WEIGHTED_FILTERED code. Removed WRITE_WEIGHTED_FILTERED code.
Avoid potentially dereferencing NULL info_ptr in png_info_init_3().
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

6
png.c
View File

@ -332,6 +332,8 @@ png_info_init_3(png_infopp ptr_ptr, png_size_t png_info_struct_size)
png_destroy_struct(info_ptr); png_destroy_struct(info_ptr);
info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO); info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO);
*ptr_ptr = info_ptr; *ptr_ptr = info_ptr;
if (info_ptr == NULL)
return;
} }
/* Set everything to 0 */ /* Set everything to 0 */
@ -728,13 +730,13 @@ png_get_copyright(png_structp png_ptr)
#else #else
#ifdef __STDC__ #ifdef __STDC__
return ((png_charp) PNG_STRING_NEWLINE \ return ((png_charp) PNG_STRING_NEWLINE \
"libpng version 1.2.54beta01 - May 9, 2015" PNG_STRING_NEWLINE \ "libpng version 1.2.54beta01 - July 30, 2015" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2015 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2015 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE); PNG_STRING_NEWLINE);
#else #else
return ((png_charp) "libpng version 1.2.54beta01 - May 9, 2015\ return ((png_charp) "libpng version 1.2.54beta01 - July 30, 2015\
Copyright (c) 1998-2015 Glenn Randers-Pehrson\ Copyright (c) 1998-2015 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."); Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.");