Skip to contentSkip to conversation

MMSD: Fix issue if there is an empty string in encoded text

PATCH New [email protected] 1 participant 1 message Feb 19, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 5/9 MMSD: Fix issue if there is an empty string in encoded text

Some carriers encode a subject with an enpty string. This patch enables MMSD to handle the empty string.

---
 src/mmsutil.c | 7 +++++++
 1 file changed, 7 insertions(+)
src/mmsutil.c +7 -0
index ef72f20..78c05d6 100644
@@ -297,6 +297,13 @@ static gboolean extract_encoded_text(struct wsp_header_iter *iter, void *user)
 	p = wsp_header_iter_get_val(iter);
 	l = wsp_header_iter_get_val_len(iter);
 
+	if(l == 0) {
+		DBG("Length is 0! Returning empty string");
+		dec_text = g_strdup("");
+		*out = dec_text;
+		return TRUE;
+	}
+
 	switch (wsp_header_iter_get_val_type(iter)) {
 	case WSP_VALUE_TYPE_TEXT:
 		/* Text-string */
Signature · 1 line
2.30.0