From 74bc55d2fa4d6d9014c5ca0c6dceb201471aef05 Mon Sep 17 00:00:00 2001 From: Mohammed Nayeem Ur Rahman Date: Wed, 10 Oct 2018 16:34:37 +0530 Subject: [PATCH] msm: adsprpc: Fix memory out of bounds error Fixes memory out of bound error. Change-Id: I9cc11b5231ba3654588eadf7a7adca68aff35684 Signed-off-by: Mohammed Nayeem Ur Rahman --- drivers/char/adsprpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c index 014bd8842cd2..7df66932cba6 100644 --- a/drivers/char/adsprpc.c +++ b/drivers/char/adsprpc.c @@ -2948,7 +2948,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp) if (err) return err; snprintf(strpid, PID_SIZE, "%d", current->pid); - buf_size = strlen(current->comm) + strlen(strpid) + 1; + buf_size = strlen(current->comm) + strlen("_") + strlen(strpid) + 1; fl->debug_buf = kzalloc(buf_size, GFP_KERNEL); snprintf(fl->debug_buf, UL_SIZE, "%.10s%s%d", current->comm, "_", current->pid);