summaryrefslogtreecommitdiff
path: root/netboot.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2013-11-21 11:48:24 -0500
committerPeter Jones <pjones@redhat.com>2013-11-21 11:48:24 -0500
commite724cfb1bf7834c21fbab2baff289e8633633c14 (patch)
treec3e1b2d8464297974a4a546dbe947fb8832bd920 /netboot.c
parentd9355ab635b2e620e6d908317627b7aa9718a999 (diff)
downloadefi-boot-shim-e724cfb1bf7834c21fbab2baff289e8633633c14.tar.gz
efi-boot-shim-e724cfb1bf7834c21fbab2baff289e8633633c14.zip
Lengths that might be -1 can't be unsigned, Peter.
Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'netboot.c')
-rw-r--r--netboot.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/netboot.c b/netboot.c
index 1732dc71..07e27735 100644
--- a/netboot.c
+++ b/netboot.c
@@ -307,10 +307,10 @@ static EFI_STATUS parseDhcp6()
static EFI_STATUS parseDhcp4()
{
CHAR8 *template = (CHAR8 *)translate_slashes(DEFAULT_LOADER_CHAR);
- UINTN template_len = strlen(template) + 1;
+ INTN template_len = strlen(template) + 1;
- UINTN dir_len = strnlena(pxe->Mode->DhcpAck.Dhcpv4.BootpBootFile, 127);
- UINTN i;
+ INTN dir_len = strnlena(pxe->Mode->DhcpAck.Dhcpv4.BootpBootFile, 127);
+ INTN i;
UINT8 *dir = pxe->Mode->DhcpAck.Dhcpv4.BootpBootFile;
for (i = dir_len; i >= 0; i--) {
@@ -329,6 +329,8 @@ static EFI_STATUS parseDhcp4()
if (full_path[dir_len-1] == '/' && template[0] == '/')
full_path[dir_len-1] = '\0';
}
+ if (dir_len == 0 && dir[0] != '/' && template[0] == '/')
+ template++;
strcata(full_path, template);
memcpy(&tftp_addr.v4, pxe->Mode->DhcpAck.Dhcpv4.BootpSiAddr, 4);