Skip to content

Commit

Permalink
irda: small read beyond end of array in debug code
Browse files Browse the repository at this point in the history
charset comes from skb->data.  It's a number in the 0-255 range.
If we have debugging turned on then this could cause a read beyond
the end of the array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Feb 27, 2013
1 parent e70ab97 commit 90c7881
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/irda/iriap.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,11 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self,
/* case CS_ISO_8859_9: */
/* case CS_UNICODE: */
default:
IRDA_DEBUG(0, "%s(), charset %s, not supported\n",
__func__, ias_charset_types[charset]);
IRDA_DEBUG(0, "%s(), charset [%d] %s, not supported\n",
__func__, charset,
charset < ARRAY_SIZE(ias_charset_types) ?
ias_charset_types[charset] :
"(unknown)");

/* Aborting, close connection! */
iriap_disconnect_request(self);
Expand Down

0 comments on commit 90c7881

Please sign in to comment.