Commit 92a62532 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

Staging: ozwpan: prevent bogus dereference

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarChris Kelly <ckelly@ozmodevices.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f2e33266
...@@ -806,7 +806,7 @@ void oz_apps_term(void) ...@@ -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) void oz_handle_app_elt(struct oz_pd *pd, u8 app_id, struct oz_elt *elt)
{ {
struct oz_app_if *ai; struct oz_app_if *ai;
if (app_id > OZ_APPID_MAX) if (app_id == 0 || app_id > OZ_APPID_MAX)
return; return;
ai = &g_app_if[app_id-1]; ai = &g_app_if[app_id-1];
ai->rx(pd, elt); ai->rx(pd, elt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment