From 0c11c636bd43feab848b087027570ae06a8e4da8 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 16 Dec 2004 20:56:52 +0000 Subject: [PATCH] gst/gstvalue.c: check that a simple string that gets deserialized does not contain invalid characters 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 | 8 ++++++++ gst/gstvalue.c | 6 ++++++ tests/old/testsuite/caps/value_serialize.c | 1 - testsuite/caps/value_serialize.c | 1 - 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 225b40278f..6ac2b8eb69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-12-16 Benjamin Otte + + * 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 Reviewed by: Ronald S. Bultje diff --git a/gst/gstvalue.c b/gst/gstvalue.c index a11a3d8f1d..1f8549c0f8 100644 --- a/gst/gstvalue.c +++ b/gst/gstvalue.c @@ -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 { diff --git a/tests/old/testsuite/caps/value_serialize.c b/tests/old/testsuite/caps/value_serialize.c index ec67141d65..b6980045ee 100644 --- a/tests/old/testsuite/caps/value_serialize.c +++ b/tests/old/testsuite/caps/value_serialize.c @@ -62,7 +62,6 @@ test_string_deserialization (void) } tests[] = { { "", ""}, { - "\\", "\\"}, { "\"\"", ""}, /* FAILURES */ { diff --git a/testsuite/caps/value_serialize.c b/testsuite/caps/value_serialize.c index ec67141d65..b6980045ee 100644 --- a/testsuite/caps/value_serialize.c +++ b/testsuite/caps/value_serialize.c @@ -62,7 +62,6 @@ test_string_deserialization (void) } tests[] = { { "", ""}, { - "\\", "\\"}, { "\"\"", ""}, /* FAILURES */ {