kconfig: loop boundary condition fix
authorJerry James <loganjerry@gmail.com>
Sat, 23 Jun 2018 20:49:04 +0000 (22:49 +0200)
committerChristian Lamparter <chunkeey@gmail.com>
Sun, 10 Feb 2019 21:13:48 +0000 (22:13 +0100)
commitc38004b50bcc9378ad1981165dc8dfbb3445c0a9
tree914393882946ae9dd837df6e28bc5c707381b892
parent9625eb0fa4e880b87250d8596bdae6ae1d95a21c
kconfig: loop boundary condition fix

If buf[-1] just happens to hold the byte 0x0A, then nread can wrap around
to (size_t)-1, leading to invalid memory accesses.

This has caused segmentation faults when trying to build the latest
kernel snapshots for i686 in Fedora:
https://bugzilla.redhat.com/show_bug.cgi?id=1592374

Signed-off-by: Jerry James <loganjerry@gmail.com>
[alexpl@fedoraproject.org: reformatted patch for submission]
Signed-off-by: Alexander Ploumistos <alexpl@fedoraproject.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
config/preprocess.c