Wrong Content-Length size ?!?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

playing with instant messaging I've found a problem regarding
the calculation of the header content length field, basically it seems
that there is space to only 5 digits when composing string to account
the body size. I've notice this while inspecting the SIP packet which was
reporting for example 108532 as

Content-Length: 10853

so only the first 5 digits seems written in the header. Does the patch below
make sense then to at least have 6 digits max available? A real patch should
take in account the max packet length and reserve the given space to represent
it.

Best regards,
Roberto Fichera.

diff --git a/pjsip/src/pjsip/sip_msg.c b/pjsip/src/pjsip/sip_msg.c
index 0ec56ad..bc059b3 100644
--- a/pjsip/src/pjsip/sip_msg.c
+++ b/pjsip/src/pjsip/sip_msg.c
@@ -476,7 +476,7 @@ PJ_DEF(pj_ssize_t) pjsip_msg_print( const pjsip_msg *msg,
 
     /* Process message body. */
     if (msg->body) {
-       enum { CLEN_SPACE = 5 };
+       enum { CLEN_SPACE = 6 };
        char *clen_pos = NULL;
 
        /* Automaticly adds Content-Type and Content-Length headers, only





[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux