Skip to content

Commit

Permalink
Staging: ozwpan: prevent bogus dereference
Browse files Browse the repository at this point in the history
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 <dan.carpenter@oracle.com>
Acked-by: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Mar 3, 2012
1 parent f2e3326 commit 92a6253
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/ozwpan/ozpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 92a6253

Please sign in to comment.