From 15c8cadd1173f681142a3f48319a203d7b917850 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Fri, 6 Sep 2013 11:46:56 +0800 Subject: discover/pxe: check for a valid boot option before adding If we didn't find any valid boot options in the pxe buffer, we'll call discover_context_add_boot_option with a NULL boot option. This change adds a check before we try to add the boot option, and a test to verify this situation. Signed-off-by: Jeremy Kerr --- discover/pxe-parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'discover') diff --git a/discover/pxe-parser.c b/discover/pxe-parser.c index 1f6eb0f..ca0f4b5 100644 --- a/discover/pxe-parser.c +++ b/discover/pxe-parser.c @@ -12,7 +12,8 @@ static void pxe_finish(struct conf_context *conf) { - discover_context_add_boot_option(conf->dc, conf->parser_info); + if (conf->parser_info) + discover_context_add_boot_option(conf->dc, conf->parser_info); } static void pxe_process_pair(struct conf_context *ctx, -- cgit v1.2.1