From dbbe8b77c176ee571fceae229ee89c4350f7d3fd Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 24 Feb 2017 14:30:26 +0000 Subject: [PATCH] vipsheader could crash on bad field names we were not checking the return of vips_image_get_as_string() --- tools/vipsheader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/vipsheader.c b/tools/vipsheader.c index 5d2892c4..f6114719 100644 --- a/tools/vipsheader.c +++ b/tools/vipsheader.c @@ -149,7 +149,8 @@ print_header( VipsImage *im, gboolean many ) else { char *str; - vips_image_get_as_string( im, main_option_field, &str ); + if( vips_image_get_as_string( im, main_option_field, &str ) ) + return( -1 ); printf( "%s\n", str ); g_free( str ); }