mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
bfd: avoid out-of-bound access
Write a nullbyte only if there is enought space for it. Cc: Stephen Röttger <stephen.roettger@gmail.com> Reported-by: Stephen Röttger <stephen.roettger@gmail.com> Signed-off-by: Andrei Vagin <avagin@openvz.org>
This commit is contained in:
committed by
Andrei Vagin
parent
0d9d271203
commit
ecbec8be07
@@ -196,6 +196,11 @@ again:
|
||||
if (!b->sz)
|
||||
return NULL;
|
||||
|
||||
if (b->sz == BUFSIZE) {
|
||||
pr_err("The bfd buffer is too small\n");
|
||||
ERR_PTR(-EIO);
|
||||
return NULL;
|
||||
}
|
||||
/*
|
||||
* Last bytes may lack the \n at the
|
||||
* end, need to report this as full
|
||||
|
Reference in New Issue
Block a user