projects
/
platform
/
upstream
/
elementary.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
401794b
)
elm_prefs_cc_parse.c: tok null check in advance.
author
Daniel Juyung Seo
<seojuyung2@gmail.com>
Sun, 11 Aug 2013 06:38:16 +0000
(15:38 +0900)
committer
Daniel Juyung Seo
<seojuyung2@gmail.com>
Sun, 11 Aug 2013 06:38:16 +0000
(15:38 +0900)
This fixes coverity CID
1040003
Dereference before null check (REVERSE_INULL).
src/bin/elm_prefs_cc_parse.c
patch
|
blob
|
history
diff --git
a/src/bin/elm_prefs_cc_parse.c
b/src/bin/elm_prefs_cc_parse.c
index 2e44c46ffda9c139eab2026f9d6ecd7fbeadc0f4..8e2bae3df5d4eb9d9368d151ea8bf5dec722275d 100644
(file)
--- a/
src/bin/elm_prefs_cc_parse.c
+++ b/
src/bin/elm_prefs_cc_parse.c
@@
-388,6
+388,7
@@
done:
*new_p = p;
tok = mem_alloc(tok_end - tok_start + 2);
+ if (!tok) return NULL;
strncpy(tok, tok_start, tok_end - tok_start + 1);
tok[tok_end - tok_start + 1] = 0;
@@
-425,7
+426,7
@@
done:
}
}
}
- else if (
(tok) && (*tok == '(')
)
+ else if (
*tok == '('
)
{
char *tmp;
tmp = tok;