[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] fix potential null dereference



handles can theoretically be NULL, check for it explicitly before
dereferencing it.

CID: 1381838
Signed-off-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 469bf98..431fe2e 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -729,7 +729,7 @@ static EFI_GRAPHICS_OUTPUT_PROTOCOL __init 
*efi_get_gop(void)
     if ( !EFI_ERROR(status) )
         status = efi_bs->LocateHandle(ByProtocol, &gop_guid, NULL, &size,
                                       handles);
-    if ( EFI_ERROR(status) )
+    if ( EFI_ERROR(status) || handles == NULL )
         size = 0;
     for ( i = 0; i < size / sizeof(*handles); ++i )
     {

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.