Re: smsc_at crashes on non-numeric SMS destination
Wilfried Goesgens <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, May 09, 2006 at 02:07:42PM +0200, Andrija Petrovic wrote:
> smsc_at does not check the digits of the address field in the function
> at2_format_address_field
> So, if the recipient's address contains a non-numeric string (e.g. 'Info
> Service'), and that's quite possible,
> the octstr assertion crashes the bearerbox during octstr_append_char.
>
> Added sanity check on digits before calling the octstr_append_char.
>
> cheers,
> Andrija
i've added the following to send_one_message to fix this:
if ((octstr_len(msg->sms.receiver)<6)||
(octstr_parse_double(&number, msg->sms.receiver,0)==-1))
{/* ok. this message is faulty. no shortcodes or non number targets */
error(0, "AT4[%s]: bad receiver %s. text %s dropping!",
octstr_get_cstr(privdata->name),
octstr_get_cstr(msg->sms.receiver),
octstr_get_cstr(msg->sms.msgdata));
if( DLR_IS_ENABLED_DEVICE(msg->sms.dlr_mask))
bb_smscconn_send_failed(privdata->conn, msg,
SMSCCONN_FAILED_MALFORMED, octstr_create("MALFORMED"));
return 0;
}
is it correct, that the message is destroyed inside bb_smscconn_send_failed?
if i destroy it after that, i get trouble...
Wilfried Gösgens