From 0cdfb2b0cd0b2c4368cdd74fd9186fc3c9f13c2e Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 20 Nov 2024 07:58:39 -0400 Subject: [PATCH] MT#55283 fix wrong string length being used These strings are not null terminated. Use the correct string length. Change-Id: I15d7541af0d9cc09401180a7d45edbec9b915aa2 (cherry picked from commit 0a1d6587661cb608ac1b3e5158f825a0545a0387) (cherry picked from commit 99415171bd7d57832a644f52d736851e56149a52) --- daemon/sdp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index 8b66708ef..9956b0cc4 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -292,6 +292,7 @@ const str rtpe_instance_id = STR_CONST_INIT(__id_buf); static void attr_free(void *p); static void attr_insert(struct sdp_attributes *attrs, struct sdp_attribute *attr); INLINE void chopper_append_c(struct sdp_chopper *c, const char *s); +INLINE void chopper_append_str(struct sdp_chopper *c, const str *s); /** * Checks whether an attribute removal request exists for a given session level. @@ -328,7 +329,7 @@ static void sdp_manipulations_add(struct sdp_chopper *chop, str * attr_value = l->data; chopper_append_c(chop, "a="); - chopper_append_c(chop, attr_value->s); + chopper_append_str(chop, attr_value); chopper_append_c(chop, "\r\n"); } }