forked from Minki/linux
crypto: hisilicon/qm - replace 'sprintf' with 'scnprintf'
Replace 'sprintf' with 'scnprintf' to avoid overrun. Signed-off-by: Weili Qian <qianweili@huawei.com> Reviewed-by: Zhou Wang <wangzhou1@hisilicon.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
cd1aff982a
commit
09493afbc6
@ -932,7 +932,8 @@ static ssize_t qm_debug_read(struct file *filp, char __user *buf,
|
||||
return -EINVAL;
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user