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