Commit ecbec8be authored by Andrei Vagin's avatar Andrei Vagin Committed by Andrei Vagin

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: 's avatarStephen Röttger <stephen.roettger@gmail.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@openvz.org>
parent 0d9d2712
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment