From 9f6f20f36c586c5f7a6daa4569982593a88b6eac Mon Sep 17 00:00:00 2001 From: Quinn Date: Wed, 23 Apr 2025 16:50:53 +0200 Subject: [PATCH] fix: invalid memory access due to dereferencing after indexing --- src/game/opts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/opts.c b/src/game/opts.c index 1a33b25..7c66a78 100644 --- a/src/game/opts.c +++ b/src/game/opts.c @@ -59,7 +59,7 @@ static inline int str_put(char* restrict* restrict dest, size_t dest_len, char c // copy the missing data to the end of the destination memcpy(*dest + dest_len, src + dest_len, src_len - dest_len); - *dest[src_len] = '\0'; // null-terminate the destination + (*dest)[src_len] = '\0'; // null-terminate the destination return 0; }