From 9ab5eba1da96502544a89e7cf3abf9abf3ad392a Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 2 Oct 2009 19:26:11 -0500 Subject: [PATCH] Fix: Handle empty SMSes If an SMS is empty (e.g. nothing to unpack) then we should simply continue on. --- src/smsutil.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/smsutil.c b/src/smsutil.c index 106a39a9..a618d073 100644 --- a/src/smsutil.c +++ b/src/smsutil.c @@ -2140,9 +2140,11 @@ char *sms_decode_text(GSList *sms_list) guint8 single_shift = 0; int max_chars = sms_text_capacity_gsm(udl, taken); - unpack_7bit_own_buf(ud + taken, udl_in_bytes - taken, + if (unpack_7bit_own_buf(ud + taken, + udl_in_bytes - taken, taken, FALSE, max_chars, - &written, 0, buf); + &written, 0, buf) == NULL) + continue; /* Take care of improperly split fragments */ if (buf[written-1] == 0x1b)