From 81df21328f86a6a4fe02139063304e535b75fb44 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Wed, 4 Jul 2007 01:29:24 +0000 Subject: [PATCH] make it a bit more permissive with its argument --- src/extract-uri.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/extract-uri.cpp b/src/extract-uri.cpp index 0461f1101..b3923ed1e 100644 --- a/src/extract-uri.cpp +++ b/src/extract-uri.cpp @@ -7,9 +7,15 @@ // http://www.w3.org/TR/CSS21/syndata.html#uri gchar *extract_uri(gchar const *s) { - gchar* result = 0; + if (!s) + return NULL; + + gchar* result = NULL; gchar const *sb = s; - g_assert( strncmp(sb, "url", 3) == 0 ); + if ( strlen(sb) < 4 || strncmp(sb, "url", 3) != 0 ) { + return NULL; + } + sb += 3; // This first whitespace technically is not allowed. -- 2.30.2