fix null string in buffer print

Some libvips header fields can be NULL, for example filename, and we
need to avoid null pointer deref on print.

See https://github.com/libvips/libvips/issues/3043
This commit is contained in:
John Cupitt 2022-09-11 14:26:53 +01:00
parent 0e7c7a9a13
commit 0b3ab3a934

View File

@ -262,6 +262,8 @@ vips_buf_appendns( VipsBuf *buf, const char *str, int sz )
if( buf->full )
return( FALSE );
if( !str )
return( TRUE );
/* Amount we want to copy.
*/