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 out of scope memory access error in file_name()
When execution takes else path, pname, a pointer, is set to point to a local variable array which has limited scope. This same pointer is accessed outside of the block containing the local variable, essentially creating a scenario where we are accessing memory outside its score, which is undefined behavior. Move the variable array out of the loop, so that it has the same scope as pname. This was found using cppcheck tool. Signed-off-by: Mohan Yelugoti <[email protected]>
- Loading branch information