From: Tobias Stoeckmann Date: Sun, 20 Oct 2024 12:12:59 +0000 (+0200) Subject: libkmod: Access correct array X-Git-Tag: v34~189 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1319ac5348dac687d73991af2a3cc638b8015ce3;p=thirdparty%2Fkmod.git 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 --- 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];