From f34baf1a2f42259a4873f6d9733078003184d4e4 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 23 Aug 2023 23:19:55 -0400 Subject: Work around https://github.com/llvm/llvm-project/issues/64946 --- src/parse.c | 3 +++ tests/xtouch.c | 3 +++ 2 files changed, 6 insertions(+) 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 #include @@ -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 { -- cgit v1.2.3