iPXE - Open Source Boot Firmware

[uri] Handle an empty unparse_uri() result properly
authorJoshua Oreman <oremanj@rwcr.net>
Wed, 27 Jan 2010 04:55:23 +0000 (23:55 -0500)
committerMarty Connor <mdc@etherboot.org>
Wed, 27 Jan 2010 13:50:49 +0000 (08:50 -0500)
commite6f08b0aa79a07bcadff203c91245db0dcd155b7
tree1511772d0d79bdd7b324d4e6ecdb941345d00436
parent329c7b78e3b0b4148c91fde910fb22b2fc0df7fe
[uri] Handle an empty unparse_uri() result properly

Previously, if none of the URI parts requested existed in the passed
URI, unparse_uri() would not touch the destination buffer at all; this
could lead to use of uninitialized data. Fix by setting buf[0] = '\0'
before unparsing whenever we have room to do so.

Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
Signed-off-by: Marty Connor <mdc@etherboot.org>
src/core/uri.c