[PATCH] smpp_pdu element reported to long, when at max length

"Arne K. Haaje" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization DrX.no
Message-ID <[email protected]>
The check for max length of PDU elements reports "to long", when element is at 
valid max length.

The check was

if (octstr_len(p->name) >= max_octets) { \
                warning(0, "SMPP: PDU element <%s> too long " \


I guess this should be

if (octstr_len(p->name) > max_octets) { \
                warning(0, "SMPP: PDU element <%s> too long " \

Arne
-- 
--------------------------------
Arne K. Haaje	| www.drx.no
T: 69 51 15 52	| M: 92 88 44 66
--------------------------------
smpp_pdu_checkLength.diff (text/x-patch, 564 B)
--- smpp_pdu.c~	2009-02-25 09:43:23.000000000 +0100
+++ smpp_pdu.c	2009-02-25 09:43:23.000000000 +0100
@@ -395,7 +395,7 @@
         append_encoded_integer(os, p->name, octets);
     #define NULTERMINATED(name, max_octets) \
         if (p->name != NULL) { \
-            if (octstr_len(p->name) >= max_octets) { \
+            if (octstr_len(p->name) > max_octets) { \
                 warning(0, "SMPP: PDU element <%s> too long " \
                         "(length is %ld, should be %d)", \
                         #name, octstr_len(p->name), max_octets-1); \
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.