Merge "msm: adsprpc: Fix memory out of bounds error"

This commit is contained in:
Linux Build Service Account 2019-01-21 22:50:39 -08:00 committed by Gerrit - the friendly Code Review server
commit 0bfccff096

View file

@ -2948,7 +2948,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp)
if (err) if (err)
return err; return err;
snprintf(strpid, PID_SIZE, "%d", current->pid); 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); fl->debug_buf = kzalloc(buf_size, GFP_KERNEL);
snprintf(fl->debug_buf, UL_SIZE, "%.10s%s%d", snprintf(fl->debug_buf, UL_SIZE, "%.10s%s%d",
current->comm, "_", current->pid); current->comm, "_", current->pid);