]> git.ipfire.org Git - thirdparty/kmod.git/commit
libkmod: check for trailing \0 in __ksymtab_strings
authorEmil Velikov <emil.l.velikov@gmail.com>
Thu, 24 Oct 2024 22:18:28 +0000 (23:18 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 15 Nov 2024 16:03:46 +0000 (10:03 -0600)
commite5ef157bd57412628ff044cf80551940b7a2dd8e
treef1c0d29b8732fd163dee07a54b9540cb8e198626
parent069d314f8a4c965c762d4db36ea6eb0cea658801
libkmod: check for trailing \0 in __ksymtab_strings

As per the documentation (man 5 elf) the section must be null
terminated. Move the check further up and remove the no longer needed
code trying to workaround non-compliant instances.

Note: drop the erroneous +1 in the overflow (malloc size) calculation

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Link: https://github.com/kmod-project/kmod/pull/210
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
libkmod/libkmod-elf.c