Here is more detailed source of my problem.

gateway/gw/smsc/smpp_pdu.def:
PDU(bind_receiver,
    0x00000001,
    HEADER
    NULTERMINATED(system_id, 16)
    NULTERMINATED(password, 9)
    NULTERMINATED(system_type, 13)
    INTEGER(interface_version, 1)
    INTEGER(addr_ton, 1)
    INTEGER(addr_npi, 1)
    NULTERMINATED(address_range, 41)
)

NULTERMINATED(password, 9) means that max. length of smsc-password is 9
octets.

If SMPP spec really allows only passwords of lenght <= 9, then however
Kannel should not segault :( Or maybe there was just a wrong consideration
about such a "small" length?

regards,
Dziugas Baltrunas

On Tue, 23 Mar 2004, Dziugas Baltrunas wrote:

> Hi list,
>
> I'm using cvs HEAD version of Kannel and I've considered with the
> following problem. Mine smsc-password is 9 characters long and here is
> what I get while launching bearerbox:
>
> 2004-03-23 09:45:34 [20054] [6] WARNING: SMPP: PDU element <password> to
> long (length is 9, should be 9)
> 2004-03-23 09:45:34 [20054] [6] WARNING: SMPP: PDU NUL terminated string
> has no NUL.
>
> What is more, afterwards it drops some more debug messages, and then
> segmentation fault occurs.
>
> Here is a snip from gateway/gw/smsc/smpp_pdu.c:
>       #define NULTERMINATED(name, max_octets) \
>         if (p->name != NULL) { \
>             if (octstr_len(p->name) >= max_octets) { \
>                 warning(0, "SMPP: PDU element <%s> to long " \
>                         "(length is %ld, should be %d)", \
>                         #name, octstr_len(p->name), max_octets); \
>                 temp = octstr_copy(p->name, 0, max_octets-1); \
>             } else \
>                 temp = octstr_duplicate(p->name); \
>             octstr_append(os, temp); \
>             octstr_destroy(temp); \
>         } \
>         octstr_append_char(os, '\0');
>
> And I still haven't got enough time to figure about something about
> max_octets. Does the (SMPP) smsc password really have some limitations?
>
> regards,
> Dziugas Baltrunas
>

Reply via email to