nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

27a4da
From 3305aab87c435486dd9f83364c145577cf80e49b Mon Sep 17 00:00:00 2001
23d2ea
From: Robert Marshall <rmarshall@redhat.com>
23d2ea
Date: Mon, 11 Jul 2016 10:59:48 -0400
27a4da
Subject: [PATCH 205/260] 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
27a4da
index 537019f2c..146858284 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
-- 
27a4da
2.13.0
23d2ea