!1214 [Pick 4.1 Release]console read 漏洞修复

Merge pull request !1214 from hw_llm/cherry-pick-1724245367
This commit is contained in:
openharmony_ci 2024-08-22 08:38:58 +00:00 committed by Gitee
commit f264fa6b13
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 1 deletions

View File

@ -687,7 +687,7 @@ STATIC ssize_t ConsoleRead(struct file *filep, CHAR *buffer, size_t bufLen)
}
if (userBuf) {
if (LOS_ArchCopyToUser(buffer, sbuffer, bufLen) != 0) {
if (LOS_ArchCopyToUser(buffer, sbuffer, ret) != 0) {
ret = -EFAULT;
goto ERROUT;
}