From: Miroslav Rezanina <mreza...@redhat.com>

It was possible to call strcmp with NULL argument, that can cause
segmentation fault. Properly checking parameters to prevent this
situation.

Signed-off-by: Miroslav Rezanina <mreza...@redhat.com>
---
 util/uri.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/util/uri.c b/util/uri.c
index e348c17..16c01d0 100644
--- a/util/uri.c
+++ b/util/uri.c
@@ -1985,7 +1985,8 @@ uri_resolve_relative (const char *uri, const char * base)
        val = g_strdup (uri);
        goto done;
     }
-    if (!strcmp(bas->path, ref->path)) {
+    if (bas->path != NULL && ref->path != NULL && 
+        !strcmp(bas->path, ref->path)) {
        val = g_strdup("");
        goto done;
     }
-- 
1.9.3


Reply via email to