summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/isdn/pcbit/drv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/isdn/pcbit/drv.c b/drivers/isdn/pcbit/drv.c
index f02cc506fbfa..4172e22ae7ed 100644
--- a/drivers/isdn/pcbit/drv.c
+++ b/drivers/isdn/pcbit/drv.c
@@ -1035,14 +1035,14 @@ static void pcbit_set_msn(struct pcbit_dev *dev, char *list)
}
ptr->next = NULL;
- ptr->msn = kmalloc(len, GFP_ATOMIC);
+ ptr->msn = kmalloc(len + 1, GFP_ATOMIC);
if (!ptr->msn) {
printk(KERN_WARNING "kmalloc failed\n");
kfree(ptr);
return;
}
- memcpy(ptr->msn, sp, len - 1);
+ memcpy(ptr->msn, sp, len);
ptr->msn[len] = 0;
#ifdef DEBUG