All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/9] Fix issue if there is an empty string in encoded text
@ 2021-03-26 10:50 Christopher Talbot
  0 siblings, 0 replies; 4+ messages in thread
From: Christopher Talbot @ 2021-03-26 10:50 UTC (permalink / raw)
  To: netdev


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(+)

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:
                /* Text-string */
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 4/9] Fix issue if there is an empty string in encoded text
  2021-04-10 14:20     ` [PATCH 3/9] Ensure Compatibility with AT&T Chris Talbot
@ 2021-04-10 14:21         ` Chris Talbot
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Talbot @ 2021-04-10 14:21 UTC (permalink / raw)
  To: ofono, netdev, debian-on-mobile-maintainers, librem-5-dev

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(+)

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:
 		/* Text-string */
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 4/9] Fix issue if there is an empty string in encoded text
@ 2021-04-10 14:21         ` Chris Talbot
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Talbot @ 2021-04-10 14:21 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 722 bytes --]

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(+)

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:
 		/* Text-string */
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 4/9] Fix issue if there is an empty string in encoded text
  2021-02-25  0:39 Patches For MMSD chris
@ 2021-02-25  0:45 ` Christopher Talbot
  0 siblings, 0 replies; 4+ messages in thread
From: Christopher Talbot @ 2021-02-25  0:45 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 724 bytes --]


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(+)

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:
 		/* Text-string */
-- 
2.30.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-10 14:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 10:50 [PATCH 4/9] Fix issue if there is an empty string in encoded text Christopher Talbot
  -- strict thread matches above, loose matches on Subject: below --
2021-04-10 14:13 [PATCH 0/9] Updates for mmsd Chris Talbot
2021-04-10 14:17 ` [PATCH 1/9] Fix mmsd to work with T-mobile Chris Talbot
2021-04-10 14:20   ` [PATCH 2/9] Ensure Compatibility with Telus Canada Chris Talbot
2021-04-10 14:20     ` [PATCH 3/9] Ensure Compatibility with AT&T Chris Talbot
2021-04-10 14:21       ` [PATCH 4/9] Fix issue if there is an empty string in encoded text Chris Talbot
2021-04-10 14:21         ` Chris Talbot
2021-02-25  0:39 Patches For MMSD chris
2021-02-25  0:45 ` [PATCH 4/9] Fix issue if there is an empty string in encoded text Christopher Talbot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.