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:
f2e3326
)
Staging: ozwpan: prevent bogus dereference
author
Dan Carpenter
<
[email protected]
>
Fri, 2 Mar 2012 06:59:55 +0000
(09:59 +0300)
committer
Greg Kroah-Hartman
<
[email protected]
>
Sat, 3 Mar 2012 00:32:21 +0000
(16:32 -0800)
app_id comes from the network and can't be trusted. If it's zero then
it will lead to a kernel crash.
Signed-off-by: Dan Carpenter <
[email protected]
>
Acked-by: Chris Kelly <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/staging/ozwpan/ozpd.c
patch
|
blob
|
history
diff --git
a/drivers/staging/ozwpan/ozpd.c
b/drivers/staging/ozwpan/ozpd.c
index 8c460f075aec23c419cef169a7f7d90cc1a3ca69..e3381add51a46fe39172172761821260ca44c219 100644
(file)
--- a/
drivers/staging/ozwpan/ozpd.c
+++ b/
drivers/staging/ozwpan/ozpd.c
@@
-806,7
+806,7
@@
void oz_apps_term(void)
void oz_handle_app_elt(struct oz_pd *pd, u8 app_id, struct oz_elt *elt)
{
struct oz_app_if *ai;
- if (app_id > OZ_APPID_MAX)
+ if (app_id
== 0 || app_id
> OZ_APPID_MAX)
return;
ai = &g_app_if[app_id-1];
ai->rx(pd, elt);