From 1319ac5348dac687d73991af2a3cc638b8015ce3 Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Sun, 20 Oct 2024 14:12:59 +0200 Subject: [PATCH] libkmod: Access correct array The contents of s and strings are identical at this point, but iterate over the correct variable nonetheless. Signed-off-by: Tobias Stoeckmann Reviewed-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/196 Signed-off-by: Lucas De Marchi --- libkmod/libkmod-elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libkmod/libkmod-elf.c b/libkmod/libkmod-elf.c index 13ef3df7..b70a66d4 100644 --- a/libkmod/libkmod-elf.c +++ b/libkmod/libkmod-elf.c @@ -450,7 +450,7 @@ int kmod_elf_get_strings(const struct kmod_elf *elf, const char *section, char * continue; } - while (strings[i] == '\0' && i < size) + while (i < size && s[i] == '\0') i++; a[j] = &s[i]; -- 2.47.3