Skip to content

Ensure EXIF is at least 4 bytes before inspection #3109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libvips/foreign/exif.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ vips_exif_load_data_without_fix( const void *data, size_t length )
/* exif_data_load_data() only allows uint for length. Limit it to less
* than that: 2**20 should be enough for anyone.
*/
if( length < 4 ) {
vips_error( "exif", "%s", _( "exif too small" ) );
return( NULL );
}
if( length > 1 << 20 ) {
vips_error( "exif", "%s", _( "exif too large" ) );
return( NULL );
Expand Down