Blob Blame History Raw
From 3305aab87c435486dd9f83364c145577cf80e49b Mon Sep 17 00:00:00 2001
From: Robert Marshall <rmarshall@redhat.com>
Date: Mon, 11 Jul 2016 10:59:48 -0400
Subject: [PATCH 205/261] Fix CLANG error from Coverity (#1154226)

Resolved a null pointer deference warning from coverity.

Related: rhbz#1154226
---
 grub-core/net/url.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/grub-core/net/url.c b/grub-core/net/url.c
index 537019f2c..146858284 100644
--- a/grub-core/net/url.c
+++ b/grub-core/net/url.c
@@ -267,7 +267,12 @@ extract_http_url_info (char *url, int ssl,
     }
 
   l = host_end - host_off;
-  c = *host_end;
+
+  if (host_end == NULL)
+    goto fail;
+  else
+    c = *host_end;
+
   *host_end = '\0';
   *host = grub_strndup (host_off, l);
   *host_end = c;
-- 
2.13.5