Skip to contentSkip to conversation

irda: small read beyond end of array in debug code

PATCH Applied Dan Carpenter 2 participants 2 messages Feb 27, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

net/irda/iriap.c +5 -2
index e71e85b..29340a9 100644
@@ -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);
maintainer Applied
#1 lore raw

From: Dan Carpenter <[email protected]>
Date: Wed, 27 Feb 2013 08:15:02 +0300

Quoted 5 lines

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.

Applied.