Don't try to parse authroity if it's not there.

Signed-off-by: Piotr Jaroszyński <[email protected]>
---
 src/core/uri.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/core/uri.c b/src/core/uri.c
index 6a1f2e5..8428d19 100644
--- a/src/core/uri.c
+++ b/src/core/uri.c
@@ -148,6 +148,9 @@ struct uri * parse_uri ( const char *uri_string ) {
        } else {
                /* Absolute/relative path */
                uri->path = path;
+
+               // No authority so jump directly to decoding
+               goto decode;
        }
 
        /* Split authority into user[:password] and host[:port] portions */
@@ -172,6 +175,7 @@ struct uri * parse_uri ( const char *uri_string ) {
                uri->port = tmp;
        }
 
+ decode:
        /* Decode fields that should be decoded */
        for ( i = URI_FIRST_FIELD; i <= URI_LAST_FIELD; i++ ) {
                const char *field = uri_get_field ( uri, i );
-- 
1.7.0.4

_______________________________________________
gPXE-devel mailing list
[email protected]
http://etherboot.org/mailman/listinfo/gpxe-devel

Reply via email to