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

Piotr Jaroszyński p.jaroszynski at gmail.com
Mon Apr 19 18:29:28 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>
---
 Good point, fixed.

 src/core/cwuri.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/core/cwuri.c b/src/core/cwuri.c
index 65e01b2..94b26d5 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;
 }
-- 
1.7.0.4



More information about the gPXE-devel mailing list