sms_decode was never memsetting the returned structure, so if any
optional elements were present in the SMS (e.g. status report) then the
structure was not completely initialized.
This patch was generated by the following semantic patch
(http://coccinelle.lip6.fr/)
// <smpl>
@fix disable is_null,isnt_null1@
expression *E;
@@
- !E
+ E == NULL
// </smpl>
The reason for this parameter has ceased to exist quite a while ago.
Namely when the API allowed multiple SMS recipients. We prepared a
single set of segments and then reset the to address and reference. We
no longer allow multiple recipients and none of this is now needed.
The new name better reflects the function's purpose.
We need to export it, as for generating unique message naming (for
persistence and D-Bus object naming), we'll be using the
address.
Introduce DECLARE_SMS_ADDR_STR(), which declares a string variable of
the right size for passing to sms_assembly_decode_address(). This way
we detach each client having to have the knowledge of what the right
size is, leaving that decission to the infrastructure
provider. Updated couple of sites in smsutil.c to use it vs a raw
declaration.
SMS cannot be split over GSM extension chars, however on the last
segment this code was causing us to overflow the buffer and resulted in
valgrind complaining.
- Change the flow of the code a bit, in the case that all fragments have
been sent and an udelivered sr arrives, we can simply remove the node
and signal undelivered up
- We ignore temporary and temporary final status reports
We were overflowing the datatype which was causing the 31st segments to
be prepended at position 0. This resulted in (very) long messages being
improperly concatenated