]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: server: check return value of fgets() in apply_server_state()
authorDragan Dosen <ddosen@haproxy.com>
Wed, 4 Nov 2015 22:03:26 +0000 (23:03 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 5 Nov 2015 09:39:09 +0000 (10:39 +0100)
commitcf4fb036a47042c86c9e3138ef01a6136fd5db87
tree0eef7a9142eaf309cb635ce93e8f05f489d9d213
parente9544935e86278dfa3d49fb4b97b860774730625
BUG/MINOR: server: check return value of fgets() in apply_server_state()

fgets() can return NULL on error or when EOF occurs. This patch adds a
check of fgets() return value and displays a warning if the first line of
the server state file can not be read. Additionally, we make sure to close
the previously opened file descriptor.
src/server.c