]> git.ipfire.org Git - thirdparty/shadow.git/commit
libmisc/yesno.c: Fix regression
authorSamanta Navarro <ferivoz@riseup.net>
Fri, 28 Apr 2023 11:54:38 +0000 (11:54 +0000)
committerSerge Hallyn <serge@hallyn.com>
Fri, 28 Apr 2023 16:22:48 +0000 (11:22 -0500)
commitc0fc4d2122057530b11567503839116dca5998ce
tree3e951b858dedbfb1baa142742f34194cb5be1db2
parent0c4fa6ee0af0c9d52c583d1cea6b655fb95724c1
libmisc/yesno.c: Fix regression

The getline function does not return a pointer but the amount of read
characters. The error return value to check for is -1.

Set buf to NULL to avoid dereference of an uninitialized stack value.

The getline function returns -1 if size argument is NULL. Always use
a valid pointer even if size is unimportant.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
libmisc/yesno.c