!153 kasan 压测时code_sign 出现string内存越界

Merge pull request !153 from tujingwei/OpenHarmony-5.0.1-Release
This commit is contained in:
openharmony_ci
2024-11-19 09:18:30 +00:00
committed by Gitee
+2 -2
View File
@@ -213,7 +213,7 @@ int parse_cert_source(unsigned long args, struct cert_source **_source)
goto copy_source_failed;
}
source->subject = kzalloc(info.signing_length, GFP_KERNEL);
source->subject = kzalloc(info.signing_length + 1, GFP_KERNEL);
if (!source->subject) {
ret = -ENOMEM;
goto copy_source_failed;
@@ -225,7 +225,7 @@ int parse_cert_source(unsigned long args, struct cert_source **_source)
goto copy_subject_failed;
}
source->issuer = kzalloc(info.issuer_length, GFP_KERNEL);
source->issuer = kzalloc(info.issuer_length + 1, GFP_KERNEL);
if (!source->issuer) {
ret = -ENOMEM;
goto copy_subject_failed;