Commit 09493afb authored by Weili Qian's avatar Weili Qian Committed by Herbert Xu

crypto: hisilicon/qm - replace 'sprintf' with 'scnprintf'

Replace 'sprintf' with 'scnprintf' to avoid overrun.
Signed-off-by: default avatarWeili Qian <qianweili@huawei.com>
Reviewed-by: default avatarZhou Wang <wangzhou1@hisilicon.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent cd1aff98
...@@ -932,7 +932,8 @@ static ssize_t qm_debug_read(struct file *filp, char __user *buf, ...@@ -932,7 +932,8 @@ static ssize_t qm_debug_read(struct file *filp, char __user *buf,
return -EINVAL; return -EINVAL;
} }
mutex_unlock(&file->lock); mutex_unlock(&file->lock);
ret = sprintf(tbuf, "%u\n", val);
ret = scnprintf(tbuf, QM_DBG_TMP_BUF_LEN, "%u\n", val);
return simple_read_from_buffer(buf, count, pos, tbuf, ret); return simple_read_from_buffer(buf, count, pos, tbuf, ret);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment