summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2022-10-01 21:15:55 +0000
committerChristos Zoulas <christos@zoulas.com>2022-10-01 21:15:55 +0000
commit83310d1483307cdae924447770311c88dbb29175 (patch)
treebba18a2e9420e4f78a75fa552fc95bbf8619cc19 /src
parentba154d74e83a8d83985c0759092ba1bdacd17c45 (diff)
downloadfile-git-83310d1483307cdae924447770311c88dbb29175.tar.gz
prevent overflow (clusterfuzz)
Diffstat (limited to 'src')
-rw-r--r--src/apprentice.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/apprentice.c b/src/apprentice.c
index d3b53b94..f6719cb5 100644
--- a/src/apprentice.c
+++ b/src/apprentice.c
@@ -32,7 +32,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.334 2022/09/27 01:58:20 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.335 2022/10/01 21:15:55 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -2916,7 +2916,7 @@ getvalue(struct magic_set *ms, struct magic *m, const char **p, int action)
}
for (q = *p; isspace(CAST(unsigned char, *q)); q++)
continue;
- if (*q == '-')
+ if (*q == '-' && ull != UINT64_MAX)
ull = -CAST(int64_t, ull);
switch (ts) {
case 1: