* src/sfnt/sfwoff2.c (compute_ULong_sum): Fix undefined shift.

Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16933
This commit is contained in:
Werner Lemberg 2019-09-03 21:10:20 +02:00
parent 543a3b939d
commit 3fa35aa420
2 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2019-09-03 Werner Lemberg <wl@gnu.org>
* src/sfnt/sfwoff2.c (compute_ULong_sum): Fix undefined shift.
Reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16933
2019-09-01 Werner Lemberg <wl@gnu.org>
* src/sfnt/sfwoff2.c (woff2_open_font): Add sanity check.

View File

@ -292,10 +292,10 @@
for ( i = 0; i < aligned_size; i += 4 )
checksum += ( buf[i ] << 24 ) |
( buf[i + 1] << 16 ) |
( buf[i + 2] << 8 ) |
( buf[i + 3] << 0 );
checksum += ( (FT_ULong)buf[i ] << 24 ) |
( (FT_ULong)buf[i + 1] << 16 ) |
( (FT_ULong)buf[i + 2] << 8 ) |
( (FT_ULong)buf[i + 3] << 0 );
/* If size is not aligned to 4, treat as if it is padded with 0s. */
if ( size != aligned_size )