From f7cb79874a509c2d1bf4eaf20ff0e51411d821cb Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 21 Sep 2023 08:12:47 -0400 Subject: [PATCH] rtspconnection: Ignore trailing whitespace in headers Part-of: --- .../gst-libs/gst/rtsp/gstrtspconnection.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c b/subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c index ae1e9d405c..dbcaa466eb 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c @@ -2375,8 +2375,16 @@ parse_line (guint8 * buffer, GstRTSPMessage * msg) comma = next_value; } else if (*next_value == ' ' && next_value[1] != ',' && next_value[1] != '=' && comma != NULL) { - next_value = comma; - comma = NULL; + /* only process this as a separate header if there is more than just + * trailing whitespace after this */ + for (gchar * curr_char = next_value; *curr_char != '\0'; + curr_char++) { + if (!g_ascii_isspace (*curr_char)) { + next_value = comma; + comma = NULL; + break; + } + } break; } } else if (*next_value == ',')