The file modules.builtin.modinfo is supposed to consist of NUL
terminated strings. If the file contains a string which is not
properly NUL terminated, treat it as error.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/83
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
}
if (linesz) {
+ if (iter->buf[linesz - 1] != '\0') {
+ sv_errno = EINVAL;
+ goto fail;
+ }
*line = iter->buf;
*size = linesz;
}