Skip to content

Commit cc4299e

Browse files
pevikmimizohar
authored andcommitted
ima: Use strscpy instead of strlcpy
strlcpy is deprecated, use its safer replacement. Signed-off-by: Petr Vorel <[email protected]> Signed-off-by: Mimi Zohar <[email protected]>
1 parent 61868ac commit cc4299e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

security/integrity/ima/ima_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ const char *ima_d_path(const struct path *path, char **pathbuf, char *namebuf)
403403
}
404404

405405
if (!pathname) {
406-
strlcpy(namebuf, path->dentry->d_name.name, NAME_MAX);
406+
strscpy(namebuf, path->dentry->d_name.name, NAME_MAX);
407407
pathname = namebuf;
408408
}
409409

security/integrity/ima/ima_policy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ static int __init ima_init_arch_policy(void)
870870
char rule[255];
871871
int result;
872872

873-
result = strlcpy(rule, *rules, sizeof(rule));
873+
result = strscpy(rule, *rules, sizeof(rule));
874874

875875
INIT_LIST_HEAD(&arch_policy_entry[i].list);
876876
result = ima_parse_rule(rule, &arch_policy_entry[i]);

0 commit comments

Comments
 (0)