summaryrefslogtreecommitdiffstats
path: root/src/extract-uri.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2007-07-04 01:29:24 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2007-07-04 01:29:24 +0000
commit94e1d6fd5ac75b14eb410a3a1dc9e02509df5a97 (patch)
treebe85a9425383a5c906e1014e211a0f8de936b114 /src/extract-uri.cpp
parentprevent crashes by disconnecting signals on destroy (diff)
downloadinkscape-94e1d6fd5ac75b14eb410a3a1dc9e02509df5a97.tar.gz
inkscape-94e1d6fd5ac75b14eb410a3a1dc9e02509df5a97.zip
make it a bit more permissive with its argument
(bzr r3177)
Diffstat (limited to '')
-rw-r--r--src/extract-uri.cpp10
1 files 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.