From 9acc7b0ebd74fcf75ff7f82ba9bbb9aa090d5beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 17 Feb 2022 12:07:43 +0400 Subject: bootp: fix g_str_has_prefix warning/critical MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: commit 60535013c3e ("bootp: add support for UEFI HTTP boot") Signed-off-by: Marc-André Lureau --- src/bootp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootp.c b/src/bootp.c index 3ade02c..a0eb17a 100644 --- a/src/bootp.c +++ b/src/bootp.c @@ -351,7 +351,7 @@ static void bootp_reply(Slirp *slirp, we assume that, if the bootfile parameter was configured as an http URL, the user intends to perform UEFI HTTP boot, so send this option automatically */ - if (g_str_has_prefix(slirp->bootp_filename, "http://")) { + if (slirp->bootp_filename && g_str_has_prefix(slirp->bootp_filename, "http://")) { val = strlen(UEFI_HTTP_VENDOR_CLASS_ID); if (q + val + 2 >= end) { g_warning("DHCP packet size exceeded, " -- cgit v1.1