summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/parse.c3
-rw-r--r--tests/xtouch.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/parse.c b/src/parse.c
index 37940de..3861610 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -582,6 +582,9 @@ static const char *parse_int(const struct parser_state *state, char **arg, const
}
}
+ // https://github.com/llvm/llvm-project/issues/64946
+ sanitize_init(&endptr);
+
if (endptr == str) {
goto bad;
}
diff --git a/tests/xtouch.c b/tests/xtouch.c
index 50416ba..4a02bf3 100644
--- a/tests/xtouch.c
+++ b/tests/xtouch.c
@@ -3,6 +3,7 @@
#include "../src/bfstd.h"
#include "../src/config.h"
+#include "../src/sanity.h"
#include "../src/xtime.h"
#include <errno.h>
#include <fcntl.h>
@@ -172,6 +173,8 @@ int main(int argc, char *argv[]) {
if (marg) {
char *end;
long mode = strtol(marg, &end, 8);
+ // https://github.com/llvm/llvm-project/issues/64946
+ sanitize_init(&end);
if (*marg && !*end && mode >= 0 && mode < 01000) {
args.fmode = args.dmode = mode;
} else {