mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
file: reserve one byte in a string buffer for the null byte
*** CID 139492: Memory - illegal accesses (BUFFER_SIZE_WARNING) Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
f62fd61709
commit
35ec944304
1 changed files with 1 additions and 1 deletions
2
files.c
2
files.c
|
|
@ -197,7 +197,7 @@ static int fixup_overlayfs(struct fd_parms *p, struct fd_link *link)
|
|||
char buf[PATH_MAX];
|
||||
int n;
|
||||
|
||||
strncpy(buf, link->name, PATH_MAX);
|
||||
strncpy(buf, link->name, PATH_MAX - 1);
|
||||
n = snprintf(link->name, PATH_MAX, "%s/%s", m->mountpoint, buf + 2);
|
||||
if (n >= PATH_MAX) {
|
||||
pr_err("Not enough space to replace %s\n", buf);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue