projects
/
platform
/
upstream
/
gflags.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4a694e8
)
fix: Static code analyzer error regarding strncmp with empty kRootDir string
author
Andreas Schuh
<andreas.schuh.84@gmail.com>
Tue, 11 Jul 2017 08:45:17 +0000
(09:45 +0100)
committer
Andreas Schuh
<andreas.schuh.84@gmail.com>
Tue, 11 Jul 2017 13:47:40 +0000
(14:47 +0100)
src/gflags.cc
patch
|
blob
|
history
diff --git
a/src/gflags.cc
b/src/gflags.cc
index
08e4f45
..
f270798
100644
(file)
--- a/
src/gflags.cc
+++ b/
src/gflags.cc
@@
-591,7
+591,7
@@
const char* CommandLineFlag::CleanFileName() const {
const char* clean_name = filename() + strlen(filename()) - 1;
while ( clean_name > filename() ) {
if (*clean_name == PATH_SEPARATOR) {
- if (strncmp(clean_name, kRootDir, sizeof(kRootDir)-1) == 0) {
+ if (s
izeof(kRootDir) > 1 && s
trncmp(clean_name, kRootDir, sizeof(kRootDir)-1) == 0) {
clean_name += sizeof(kRootDir)-1; // past root-dir
break;
}