summaryrefslogtreecommitdiff
path: root/ext/fileinfo/libmagic/softmagic.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fileinfo/libmagic/softmagic.c')
-rw-r--r--ext/fileinfo/libmagic/softmagic.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c
index ddf7370b50..24fa0ec436 100644
--- a/ext/fileinfo/libmagic/softmagic.c
+++ b/ext/fileinfo/libmagic/softmagic.c
@@ -1637,7 +1637,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
break;
case FILE_REGEX:
- if (OFFSET_OOB(nbytes, offset, 0))
+ if (nbytes < offset)
return 0;
break;
@@ -1646,7 +1646,8 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
offset += CAST(uint32_t, o);
if (offset == 0)
return 0;
- if (OFFSET_OOB(nbytes, offset, 0))
+
+ if (nbytes < offset)
return 0;
if ((pb = file_push_buffer(ms)) == NULL)
@@ -1677,7 +1678,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
return rv;
case FILE_USE:
- if (OFFSET_OOB(nbytes, offset, 0))
+ if (nbytes < offset)
return 0;
rbuf = m->value.s;
if (*rbuf == '^') {