diff options
author | Christos Zoulas <christos@zoulas.com> | 2017-03-09 16:57:53 +0000 |
---|---|---|
committer | Christos Zoulas <christos@zoulas.com> | 2017-03-09 16:57:53 +0000 |
commit | c0a40def2f4f08ee17c46f8fca2c8b05d67c68a1 (patch) | |
tree | a43046ff42f145b3ff10ad8758dac4d3eb05f9a3 | |
parent | 052664a627e88c7fc15d133e80a5d07e2df0d89a (diff) | |
download | file-git-c0a40def2f4f08ee17c46f8fca2c8b05d67c68a1.tar.gz |
use the correct buffer size; found by oss-fuzz
-rw-r--r-- | src/readcdf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/readcdf.c b/src/readcdf.c index 20e631d6..513bbb94 100644 --- a/src/readcdf.c +++ b/src/readcdf.c @@ -26,7 +26,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: readcdf.c,v 1.63 2016/10/18 22:25:42 christos Exp $") +FILE_RCSID("@(#)$File: readcdf.c,v 1.64 2017/03/09 16:57:53 christos Exp $") #endif #include <assert.h> @@ -603,7 +603,7 @@ file_trycdf(struct magic_set *ms, int fd, const unsigned char *buf, if ((i = cdf_read_user_stream(&info, &h, &sat, &ssat, &sst, &dir, "FileHeader", &scn)) != -1) { #define HWP5_SIGNATURE "HWP Document File" - if (scn.sst_dirlen >= sizeof(HWP5_SIGNATURE) - 1 + if (scn.sst_len * scn.sst_ss >= sizeof(HWP5_SIGNATURE) - 1 && memcmp(scn.sst_tab, HWP5_SIGNATURE, sizeof(HWP5_SIGNATURE) - 1) == 0) { if (NOTMIME(ms)) { |