[settings] Avoid returning uninitialised data on error in fetch_xxx_setting()
authorMichael Brown <mcb30@etherboot.org>
Wed, 22 Oct 2008 20:18:15 +0000 (21:18 +0100)
committerMichael Brown <mcb30@etherboot.org>
Wed, 22 Oct 2008 21:07:13 +0000 (22:07 +0100)
commit612f4e7a990272f67dc1461e6cf1c5ad3b83dd14
tree7c033dd0697d112086a8dfe43708f25e8e69d5d1
parentcbf9003d665577ab637b122929ce1f21e71418c4
[settings] Avoid returning uninitialised data on error in fetch_xxx_setting()

Callers (e.g. usr/autoboot.c) may not check the return values from
fetch_xxx_setting(), assuming that in error cases the returned setting
value will be "empty" (for some sensible value of "empty").

In particular, if the DHCP server did not specify a next-server
address, this would result in gPXE using uninitialised data for the
TFTP server IP address.
src/core/settings.c