libkmod: Fix OOB write with illegal index files
If an index file with INDEX_NODE_CHILDS flag contains illegal first
and last markers for children, it is possible to trigger an out of
boundary write.
Make sure that first value is not larger than last value while reading
index files.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/126
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>