projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
60aff4f
)
staging: dgap: fix possible NULL dereference
author
Sudip Mukherjee
<
[email protected]
>
Thu, 10 Sep 2015 11:54:58 +0000
(17:24 +0530)
committer
Greg Kroah-Hartman
<
[email protected]
>
Sun, 13 Sep 2015 01:24:57 +0000
(18:24 -0700)
The return pointer from dgap_getword() is used in strcmp() where it is
dereferenced. But dgap_getword() can return NULL.
Lets put a check there and return 0 as error.
Signed-off-by: Sudip Mukherjee <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/staging/dgap/dgap.c
patch
|
blob
|
history
diff --git
a/drivers/staging/dgap/dgap.c
b/drivers/staging/dgap/dgap.c
index 9112dd2bf4d7757503ea1b53191d213dcbc93785..20ba258ffbdb3165ea41deb8bc476a226bee00f4 100644
(file)
--- a/
drivers/staging/dgap/dgap.c
+++ b/
drivers/staging/dgap/dgap.c
@@
-349,6
+349,8
@@
static int dgap_gettok(char **in)
if (strstr(dgap_cword, "board")) {
w = dgap_getword(in);
+ if (!w)
+ return 0;
snprintf(dgap_cword, MAXCWORD, "%s", w);
for (t = dgap_brdtype; t->token != 0; t++) {
if (!strcmp(w, t->string))