arrfab / rpms / shim

Forked from rpms/shim 4 years ago
Clone

Blame SOURCES/0074-Correctly-reject-bad-tftp-addresses-earlier-rather-t.patch

e97c83
From c0949c0a7916e81767ab35f67005b80cfb565e2c Mon Sep 17 00:00:00 2001
e97c83
From: Peter Jones <pjones@redhat.com>
e97c83
Date: Sun, 21 Sep 2014 15:19:34 -0400
e97c83
Subject: [PATCH 74/74] Correctly reject bad tftp addresses earlier, rather
e97c83
 than later.
e97c83
e97c83
This check is for end == NULL but was meant to be *end == '\0'.  Without
e97c83
this change, we'll pass a plausibly bad address (i.e. one with no ']' at
e97c83
the end) to Mtftp(... READ_FILE ...), which should fail correctly, but
e97c83
our error messaging will be inconsistent.
e97c83
e97c83
Signed-off-by: Peter Jones <pjones@redhat.com>
e97c83
---
e97c83
 netboot.c | 2 +-
e97c83
 1 file changed, 1 insertion(+), 1 deletion(-)
e97c83
e97c83
diff --git a/netboot.c b/netboot.c
e97c83
index f884cba..ad5d37e 100644
e97c83
--- a/netboot.c
e97c83
+++ b/netboot.c
e97c83
@@ -234,7 +234,7 @@ static BOOLEAN extract_tftp_info(CHAR8 *url)
e97c83
 			return FALSE;
e97c83
 		}
e97c83
 	}
e97c83
-	if (end == '\0') {
e97c83
+	if (*end == '\0') {
e97c83
 		Print(L"TFTP SERVER MUST BE ENCLOSED IN [..]\n");
e97c83
 		return FALSE;
e97c83
 	}
e97c83
-- 
e97c83
1.9.3
e97c83