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

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