diff options
author | Patrick Masotta <masottaus@yahoo.com> | 2015-08-01 07:40:16 -0400 |
---|---|---|
committer | Gene Cumm <gene.cumm@gmail.com> | 2015-08-01 07:40:34 -0400 |
commit | e466d2498604c8eea055a8e98284d65311073b39 (patch) | |
tree | 061d29a703dfc94ab96471c0bf907c035920dfef | |
parent | f858a5428ed992388da00c5dc7e4f73195d4efb0 (diff) | |
download | syslinux-e466d2498604c8eea055a8e98284d65311073b39.tar.gz syslinux-e466d2498604c8eea055a8e98284d65311073b39.tar.xz syslinux-e466d2498604c8eea055a8e98284d65311073b39.zip |
efi/main: set/check for NULL in efi_create_binding()
If LibLocateHandle() returns success and either 0 handles or we find no
matching handles, treat it the same.
Originally-By: Patrick Masotta <masottaus@yahoo.com>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
-rw-r--r-- | efi/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -81,7 +81,7 @@ bool efi_get_MAC( EFI_DEVICE_PATH * pDevPath, uint8_t * mac, uint16_t mac_size) /* As of UEFI-2.4.0, all EFI_SERVICE_BINDINGs are for networking */ struct efi_binding *efi_create_binding(EFI_GUID *bguid, EFI_GUID *pguid) { - EFI_SERVICE_BINDING *sbp; + EFI_SERVICE_BINDING *sbp = NULL; struct efi_binding *b; EFI_STATUS status; EFI_HANDLE sb_handle, protocol, child; @@ -126,7 +126,7 @@ struct efi_binding *efi_create_binding(EFI_GUID *bguid, EFI_GUID *pguid) } } - if (status != EFI_SUCCESS) + if (status != EFI_SUCCESS || sbp == NULL) goto free_binding; child = NULL; |