mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
mount: fix unbounded write
Replace sprintf() with snprintf() and specify maximum length of characters to avoid potential overflow. Reported-by: GitHub CodeQL (https://codeql.github.com/) Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
parent
708f872a6d
commit
30aa8dbe4d
1 changed files with 1 additions and 1 deletions
|
|
@ -98,7 +98,7 @@ static char *ext_mount_lookup(char *key)
|
|||
int len = strlen(key);
|
||||
char mkey[len + 6];
|
||||
|
||||
sprintf(mkey, "mnt[%s]", key);
|
||||
snprintf(mkey, sizeof(mkey), "mnt[%s]", key);
|
||||
v = external_lookup_by_key(mkey);
|
||||
if (IS_ERR(v))
|
||||
v = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue