aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/iriap.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/irda/iriap.c')
-rw-r--r--net/irda/iriap.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index fce364c6c71a..f876eed7d4aa 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -87,6 +87,8 @@ static inline void iriap_start_watchdog_timer(struct iriap_cb *self,
87 iriap_watchdog_timer_expired); 87 iriap_watchdog_timer_expired);
88} 88}
89 89
90static struct lock_class_key irias_objects_key;
91
90/* 92/*
91 * Function iriap_init (void) 93 * Function iriap_init (void)
92 * 94 *
@@ -114,6 +116,9 @@ int __init iriap_init(void)
114 return -ENOMEM; 116 return -ENOMEM;
115 } 117 }
116 118
119 lockdep_set_class_and_name(&irias_objects->hb_spinlock, &irias_objects_key,
120 "irias_objects");
121
117 /* 122 /*
118 * Register some default services for IrLMP 123 * Register some default services for IrLMP
119 */ 124 */
@@ -502,7 +507,8 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self,
502 IRDA_DEBUG(4, "%s(), strlen=%d\n", __func__, value_len); 507 IRDA_DEBUG(4, "%s(), strlen=%d\n", __func__, value_len);
503 508
504 /* Make sure the string is null-terminated */ 509 /* Make sure the string is null-terminated */
505 fp[n+value_len] = 0x00; 510 if (n + value_len < skb->len)
511 fp[n + value_len] = 0x00;
506 IRDA_DEBUG(4, "Got string %s\n", fp+n); 512 IRDA_DEBUG(4, "Got string %s\n", fp+n);
507 513
508 /* Will truncate to IAS_MAX_STRING bytes */ 514 /* Will truncate to IAS_MAX_STRING bytes */
@@ -655,10 +661,16 @@ static void iriap_getvaluebyclass_indication(struct iriap_cb *self,
655 n = 1; 661 n = 1;
656 662
657 name_len = fp[n++]; 663 name_len = fp[n++];
664
665 IRDA_ASSERT(name_len < IAS_MAX_CLASSNAME + 1, return;);
666
658 memcpy(name, fp+n, name_len); n+=name_len; 667 memcpy(name, fp+n, name_len); n+=name_len;
659 name[name_len] = '\0'; 668 name[name_len] = '\0';
660 669
661 attr_len = fp[n++]; 670 attr_len = fp[n++];
671
672 IRDA_ASSERT(attr_len < IAS_MAX_ATTRIBNAME + 1, return;);
673
662 memcpy(attr, fp+n, attr_len); n+=attr_len; 674 memcpy(attr, fp+n, attr_len); n+=attr_len;
663 attr[attr_len] = '\0'; 675 attr[attr_len] = '\0';
664 676