dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone
Blob Blame History Raw
From 5be3c46a14e86443bb58a11d1d7ca52ecf01f418 Mon Sep 17 00:00:00 2001
From: Robert Marshall <rmarshall@redhat.com>
Date: Mon, 11 Jul 2016 10:59:48 -0400
Subject: [PATCH 206/206] 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 537019f..1468582 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.5.5