[PATCH] SMPP panic when sender or receiver address longer then 20 characters.
"Oded Arbel" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi list We encountered a bug that causes SMPP to panic when creating the PDU if the receiver or sender address is longer then 20 characters. the panic occures in smpp_pdu.c in smpp_pdu_pack which asserts on the length of the source Octstr before packing it into the PDU. I don't want to change the assert, just make sure that it will not be invoked just because the user enetered bad data, so attached is this patch. -- Oded Arbel m-Wise mobile solutions [email protected] +972-9-9581711 (116) +972-67-340014 ::.. "I realized that the purpose of writing is to inflate weak ideas." -- Calvin and Hobbes <<smsc_smpp.patch>>
smsc_smpp.patch
(application/octet-stream, 718 B)
--- gateway/gw/smsc/smsc_smpp.c 2002-08-08 20:44:38.000000000 +0300
+++ gateway/gw/smsc/smsc_smpp.c 2002-08-07 12:18:28.000000000 +0300
@@ -264,8 +270,8 @@
pdu = smpp_pdu_create(submit_sm,
counter_increase(smpp->message_id_counter));
- pdu->u.submit_sm.source_addr = octstr_duplicate(msg->sms.sender);
- pdu->u.submit_sm.destination_addr = octstr_duplicate(msg->sms.receiver);
+ pdu->u.submit_sm.source_addr = octstr_copy(msg->sms.sender,0,20);
+ pdu->u.submit_sm.destination_addr = octstr_copy(msg->sms.receiver,0,20);
/* Check for manual override of source ton and npi values */
if(smpp->source_addr_ton > -1 && smpp->source_addr_npi > -1) {