diff options
| author | Peter Jones <pjones@redhat.com> | 2013-11-21 11:48:24 -0500 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2013-11-21 11:48:24 -0500 |
| commit | e724cfb1bf7834c21fbab2baff289e8633633c14 (patch) | |
| tree | c3e1b2d8464297974a4a546dbe947fb8832bd920 | |
| parent | d9355ab635b2e620e6d908317627b7aa9718a999 (diff) | |
| download | efi-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>
| -rw-r--r-- | netboot.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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); |
