diff mbox series

[4/9] Fix issue if there is an empty string in encoded text

Message ID 7e6ec700d812d9d3a8d2ec6a621118dad2f8e9dd.camel@talbothome.com (mailing list archive)
State Not Applicable
Headers show
Series A set of patches for ofono/mmsd | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Chris Talbot March 26, 2021, 10:50 a.m. UTC
A swedish carrier sends an empty string in the subject line. This
patch allows mmsd to handle it
---
 src/mmsutil.c | 7 +++++++
 1 file changed, 7 insertions(+)

                /* Text-string */
diff mbox series

Patch

diff --git a/src/mmsutil.c b/src/mmsutil.c
index 9430bf1..615198f 100644
--- a/src/mmsutil.c
+++ b/src/mmsutil.c
@@ -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: