* [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; 2+ 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] 2+ 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; 2+ 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] 2+ messages in thread
end of thread, other threads:[~2021-04-10 14:22 UTC | newest]
Thread overview: 2+ 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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).