[BUG] ls-files showing deleted files (unchecked lstat return value)
- From
- Joe Ranieri <jranieri@grammatech.com>
- Date
- Feb 17, 2019, 13:49 UTC
- Message-ID
- <1ff48830-f3de-11f4-9014-c20eb3890c21@grammatech.com>
"git ls-files -m" can show deleted files, despite -d not having been specified. This is due to ls-files.c's show_files function calling lstat but not checking the return value before calling ie_modified with the uninitialized stat structure.
This problem was found using the static analysis tool GrammaTech CodeSonar.
-- Thanks and Regards, Joe Ranieri Software Engineer GrammaTech, Inc.