diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/irda/iriap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/irda/iriap.c b/net/irda/iriap.c index 294e34d3517c..f7d6150e0903 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c @@ -501,7 +501,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 */ |