From 61206c245de7870eeb65417ffdb1c98b8fee88e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Jaroszy=C5=84ski?= Date: Mon, 12 Apr 2010 17:37:10 +0200 Subject: [PATCH] [uri] Special case NULL in churi() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit resolve_uri() doesn't (and probably shouldn't) handle NULL relative_uri. Signed-off-by: Piotr JaroszyƄski Reviewed-by: Stefan Hajnoczi Signed-off-by: Marty Connor Signed-off-by: Michael Brown --- src/core/cwuri.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/cwuri.c b/src/core/cwuri.c index f649ba44..893e2050 100644 --- a/src/core/cwuri.c +++ b/src/core/cwuri.c @@ -38,9 +38,11 @@ struct uri *cwuri = NULL; * @v uri New working URI, or NULL */ void churi ( struct uri *uri ) { - struct uri *new_uri; + struct uri *new_uri = NULL; + + if ( uri ) + new_uri = resolve_uri ( cwuri, uri ); - new_uri = resolve_uri ( cwuri, uri ); uri_put ( cwuri ); cwuri = new_uri; }