From 6e01d03d90a146b3b9c9af7603b27233da2bf04d Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 11 Jul 2016 18:45:49 +0530 Subject: [PATCH] benchmarks: Fix potential stack corruption in capsnego test flavour_str is a non-const pointer that will be written to if the -f option is passed --- tests/benchmarks/capsnego.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/benchmarks/capsnego.c b/tests/benchmarks/capsnego.c index dc60194e33..5a7a39050f 100644 --- a/tests/benchmarks/capsnego.c +++ b/tests/benchmarks/capsnego.c @@ -185,7 +185,7 @@ gint main (gint argc, gchar * argv[]) { /* default parameters */ - const gchar *flavour_str = "audio"; + gchar *flavour_str = g_strdup("audio"); gint flavour = FLAVOUR_AUDIO; gint children = 3; gint depth = 4; @@ -230,6 +230,8 @@ main (gint argc, gchar * argv[]) /* build pipeline */ g_print ("building %s pipeline with depth = %d and children = %d\n", flavour_str, depth, children); + g_free (flavour_str); + start = gst_util_get_timestamp (); bin = GST_BIN (gst_pipeline_new ("pipeline")); sink = gst_element_factory_make ("fakesink", NULL);