From 4b5422181deb3b09a7926aa51a7b26d656ca15ba Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Mon, 16 Jan 2023 10:43:41 +0000 Subject: [PATCH] Fix use-after-free in fuzzpuzz When reporting that the game name in a save file isn't recognised, don't include the name from the save file in the error message, partly to avoid the complexity of freeing it properly on two different code paths and partly because including unsanitized data from a fuzzer-supplied save file in the error message just seems dangerous. And properly sanitising it would waste the fuzzer's time exploring the sanitising code. Thanks to Ben Hutchings for reporting the bug. --- fuzzpuzz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzzpuzz.c b/fuzzpuzz.c index 2b6037c..6e1dc65 100644 --- a/fuzzpuzz.c +++ b/fuzzpuzz.c @@ -81,7 +81,7 @@ int main(int argc, char **argv) ourgame = gamelist[i]; sfree(gamename); if (ourgame == NULL) { - fprintf(stderr, "Game '%s' not recognised\n", gamename); + fprintf(stderr, "Game not recognised\n"); ret = 1; continue; }