Commit 90c7881e authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

irda: small read beyond end of array in debug code

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e70ab977
...@@ -495,8 +495,11 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self, ...@@ -495,8 +495,11 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self,
/* case CS_ISO_8859_9: */ /* case CS_ISO_8859_9: */
/* case CS_UNICODE: */ /* case CS_UNICODE: */
default: default:
IRDA_DEBUG(0, "%s(), charset %s, not supported\n", IRDA_DEBUG(0, "%s(), charset [%d] %s, not supported\n",
__func__, ias_charset_types[charset]); __func__, charset,
charset < ARRAY_SIZE(ias_charset_types) ?
ias_charset_types[charset] :
"(unknown)");
/* Aborting, close connection! */ /* Aborting, close connection! */
iriap_disconnect_request(self); iriap_disconnect_request(self);
......
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