From bc066cf2ca3132da350b7d6e5ee620e8120c1006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 24 Jan 2011 14:22:27 +0000 Subject: [PATCH] tests: add unit test for read-beyond-end-of-string bug https://bugzilla.gnome.org/show_bug.cgi?id=639674 --- tests/check/pipelines/parse-launch.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/check/pipelines/parse-launch.c b/tests/check/pipelines/parse-launch.c index 407c2d2ddb..0f02b67cd3 100644 --- a/tests/check/pipelines/parse-launch.c +++ b/tests/check/pipelines/parse-launch.c @@ -632,6 +632,17 @@ GST_START_TEST (test_flags) GST_END_TEST; +GST_START_TEST (test_parsing) +{ + GstElement *pipeline; + + /* make sure we don't read beyond the end of the string */ + pipeline = gst_parse_launch_full ("filesrc location=x\\", NULL, 0, NULL); + gst_object_unref (pipeline); +} + +GST_END_TEST; + static Suite * parse_suite (void) { @@ -649,6 +660,7 @@ parse_suite (void) tcase_add_test (tc_chain, delayed_link); tcase_add_test (tc_chain, test_flags); tcase_add_test (tc_chain, test_missing_elements); + tcase_add_test (tc_chain, test_parsing); return s; }