Skip to content

Commit

Permalink
irda: Fix heap memory corruption in iriap.c
Browse files Browse the repository at this point in the history
While parsing the GetValuebyClass command frame, we could potentially write
passed the skb->data pointer.

Cc: stable@kernel.org
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
  • Loading branch information
Samuel Ortiz authored and Samuel Ortiz committed Oct 11, 2010
1 parent efc463e commit 37f9fc4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/irda/iriap.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,8 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self,
IRDA_DEBUG(4, "%s(), strlen=%d\n", __func__, value_len);

/* Make sure the string is null-terminated */
fp[n+value_len] = 0x00;
if (n + value_len < skb->len)
fp[n + value_len] = 0x00;
IRDA_DEBUG(4, "Got string %s\n", fp+n);

/* Will truncate to IAS_MAX_STRING bytes */
Expand Down

0 comments on commit 37f9fc4

Please sign in to comment.