[gPXE-devel] [PATCH 2/2] [uri] Special case NULL in churi()

Piotr Jaroszyński p.jaroszynski at gmail.com
Mon Apr 12 11:54:49 EDT 2010


resolve_uri() doesn't (and probably shouldn't) handle NULL relative_uri.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski at gmail.com>
---
 src/core/cwuri.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/core/cwuri.c b/src/core/cwuri.c
index 65e01b2..98e56a6 100644
--- a/src/core/cwuri.c
+++ b/src/core/cwuri.c
@@ -40,7 +40,11 @@ struct uri *cwuri = NULL;
 void churi ( struct uri *uri ) {
 	struct uri *new_uri;
 
-	new_uri = resolve_uri ( cwuri, uri );
+	if ( uri )
+		new_uri = resolve_uri ( cwuri, uri );
+	else
+		new_uri = uri;
+
 	uri_put ( cwuri );
 	cwuri = new_uri;
 }
-- 
1.7.0.4



More information about the gPXE-devel mailing list