dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0206-Fix-CLANG-error-from-Coverity-1154226.patch

23d2ea
From 5be3c46a14e86443bb58a11d1d7ca52ecf01f418 Mon Sep 17 00:00:00 2001
23d2ea
From: Robert Marshall <rmarshall@redhat.com>
23d2ea
Date: Mon, 11 Jul 2016 10:59:48 -0400
23d2ea
Subject: [PATCH 206/206] Fix CLANG error from Coverity (#1154226)
23d2ea
23d2ea
Resolved a null pointer deference warning from coverity.
23d2ea
23d2ea
Related: rhbz#1154226
23d2ea
---
23d2ea
 grub-core/net/url.c | 7 ++++++-
23d2ea
 1 file changed, 6 insertions(+), 1 deletion(-)
23d2ea
23d2ea
diff --git a/grub-core/net/url.c b/grub-core/net/url.c
23d2ea
index 537019f..1468582 100644
23d2ea
--- a/grub-core/net/url.c
23d2ea
+++ b/grub-core/net/url.c
23d2ea
@@ -267,7 +267,12 @@ extract_http_url_info (char *url, int ssl,
23d2ea
     }
23d2ea
 
23d2ea
   l = host_end - host_off;
23d2ea
-  c = *host_end;
23d2ea
+
23d2ea
+  if (host_end == NULL)
23d2ea
+    goto fail;
23d2ea
+  else
23d2ea
+    c = *host_end;
23d2ea
+
23d2ea
   *host_end = '\0';
23d2ea
   *host = grub_strndup (host_off, l);
23d2ea
   *host_end = c;
23d2ea
-- 
23d2ea
2.5.5
23d2ea