dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

28f7f8
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
23d2ea
From: Robert Marshall <rmarshall@redhat.com>
23d2ea
Date: Mon, 11 Jul 2016 10:59:48 -0400
28f7f8
Subject: [PATCH] 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
28f7f8
index 537019f2c78..146858284cd 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;