Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libkmod: Fix overflow in kmod_module_hex_to_str
If an overly long signature is found in a module file, it is possible to trigger an out of boundary write in kmod_module_hex_to_str due to integer and subsequent heap buffer overflow. This approach replaces malloc + sprintf with a simple hex-lookup and a strbuf approach, being slightly faster in real life scenarios while adding around 100 bytes to library size. A much faster approach could be done without strbuf and using our overflow check functions, but readability should win here. Signed-off-by: Tobias Stoeckmann <[email protected]> Link: #236 Signed-off-by: Lucas De Marchi <[email protected]>
- Loading branch information