Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib/gis: Fix possible null pointer arithmetic scenario in lz4 module
`LZ4_decompress_generic` function has an argument called `dictStart`, whose usage was only triggered when it was set to use external dict. This function was called with this argument as NULL, but without checking whether it's NULL, we were doing some arithmetic on this argument in the function and assigning it to another variable. Similarly, in another instance, we were doing arithmetic on this variable without checking if it's NULL which could possibly lead to null pointer arithmetic in specific scnearios, which is undefined behavior. This patch adds a simple fix to check if the pointer is NULL or not, before doing any arithmetic on it. This was found using cppcheck static analysis tool. Signed-off-by: Mohan Yelugoti <[email protected]>
- Loading branch information