gst/gstvalue.c: check that a simple string that gets deserialized does not contain...
authorBenjamin Otte <otte@gnome.org>
Thu, 16 Dec 2004 20:56:52 +0000 (20:56 +0000)
committerBenjamin Otte <otte@gnome.org>
Thu, 16 Dec 2004 20:56:52 +0000 (20:56 +0000)
Original commit message from CVS:
* gst/gstvalue.c: (gst_value_deserialize_string):
check that a simple string that gets deserialized does not contain
invalid characters
* testsuite/caps/value_serialize.c: (test_string_deserialization):
remove a test that tested a wring behaviour

ChangeLog
gst/gstvalue.c
tests/old/testsuite/caps/value_serialize.c
testsuite/caps/value_serialize.c

index 225b402..6ac2b8e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-12-16  Benjamin Otte  <in7y118@public.uni-hamburg.de>
+
+       * gst/gstvalue.c: (gst_value_deserialize_string):
+         check that a simple string that gets deserialized does not contain
+         invalid characters
+       * testsuite/caps/value_serialize.c: (test_string_deserialization):
+         remove a test that tested a wring behaviour
+
 2004-12-16  Matt Kraai  <kraai@alumni.cmu.edu>
 
        Reviewed by:  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
index a11a3d8..1f8549c 100644 (file)
@@ -1332,6 +1332,12 @@ static gboolean
 gst_value_deserialize_string (GValue * dest, const char *s)
 {
   if (*s != '"') {
+    const gchar *t = s;
+
+    while (GST_ASCII_IS_STRING (*t))
+      t++;
+    if (!*t == '\0')
+      return FALSE;
     g_value_set_string (dest, s);
     return TRUE;
   } else {
index ec67141..b698004 100644 (file)
@@ -62,7 +62,6 @@ test_string_deserialization (void)
   } tests[] = {
     {
     "", ""}, {
-    "\\", "\\"}, {
     "\"\"", ""},
         /* FAILURES */
     {
index ec67141..b698004 100644 (file)
@@ -62,7 +62,6 @@ test_string_deserialization (void)
   } tests[] = {
     {
     "", ""}, {
-    "\\", "\\"}, {
     "\"\"", ""},
         /* FAILURES */
     {