|
|
f2fa6b |
From 27129a5a05d1947e6f7479766e8281d50d6031f6 Mon Sep 17 00:00:00 2001
|
|
|
e22f8f |
From: Peter Jones <pjones@redhat.com>
|
|
|
e22f8f |
Date: Thu, 21 Nov 2013 11:26:08 -0500
|
|
|
f2fa6b |
Subject: [PATCH 13/19] Lengths that might be -1 can't be unsigned, Peter.
|
|
|
e22f8f |
|
|
|
e22f8f |
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
|
e22f8f |
---
|
|
|
e22f8f |
netboot.c | 8 +++++---
|
|
|
e22f8f |
1 file changed, 5 insertions(+), 3 deletions(-)
|
|
|
e22f8f |
|
|
|
e22f8f |
diff --git a/netboot.c b/netboot.c
|
|
|
e22f8f |
index 1732dc7..07e2773 100644
|
|
|
e22f8f |
--- a/netboot.c
|
|
|
e22f8f |
+++ b/netboot.c
|
|
|
e22f8f |
@@ -307,10 +307,10 @@ static EFI_STATUS parseDhcp6()
|
|
|
e22f8f |
static EFI_STATUS parseDhcp4()
|
|
|
e22f8f |
{
|
|
|
e22f8f |
CHAR8 *template = (CHAR8 *)translate_slashes(DEFAULT_LOADER_CHAR);
|
|
|
e22f8f |
- UINTN template_len = strlen(template) + 1;
|
|
|
e22f8f |
+ INTN template_len = strlen(template) + 1;
|
|
|
e22f8f |
|
|
|
e22f8f |
- UINTN dir_len = strnlena(pxe->Mode->DhcpAck.Dhcpv4.BootpBootFile, 127);
|
|
|
e22f8f |
- UINTN i;
|
|
|
e22f8f |
+ INTN dir_len = strnlena(pxe->Mode->DhcpAck.Dhcpv4.BootpBootFile, 127);
|
|
|
e22f8f |
+ INTN i;
|
|
|
e22f8f |
UINT8 *dir = pxe->Mode->DhcpAck.Dhcpv4.BootpBootFile;
|
|
|
e22f8f |
|
|
|
e22f8f |
for (i = dir_len; i >= 0; i--) {
|
|
|
e22f8f |
@@ -329,6 +329,8 @@ static EFI_STATUS parseDhcp4()
|
|
|
e22f8f |
if (full_path[dir_len-1] == '/' && template[0] == '/')
|
|
|
e22f8f |
full_path[dir_len-1] = '\0';
|
|
|
e22f8f |
}
|
|
|
e22f8f |
+ if (dir_len == 0 && dir[0] != '/' && template[0] == '/')
|
|
|
e22f8f |
+ template++;
|
|
|
e22f8f |
strcata(full_path, template);
|
|
|
e22f8f |
memcpy(&tftp_addr.v4, pxe->Mode->DhcpAck.Dhcpv4.BootpSiAddr, 4);
|
|
|
e22f8f |
|
|
|
e22f8f |
--
|
|
|
f2fa6b |
1.8.5.3
|
|
|
e22f8f |
|