summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-10-23 11:31:11 +0000
committerBenny Prijono <bennylp@teluu.com>2008-10-23 11:31:11 +0000
commitcebdf0a62795af2d57a2e2e7574d8f17262a4361 (patch)
tree315070ebe981dfe9268888c0c8ec3ae0cc7f184d
parent60d3d9c798c7b645cbb7d94a2a679c20d0ea06b5 (diff)
Ticket #667: Padding issue when the old/RFC 3489 STUN client is communicating with new/STUNbis STUN server
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2356 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjlib-util/src/pjlib-util/stun_simple.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pjlib-util/src/pjlib-util/stun_simple.c b/pjlib-util/src/pjlib-util/stun_simple.c
index e06d0b1e..43cb81c3 100644
--- a/pjlib-util/src/pjlib-util/stun_simple.c
+++ b/pjlib-util/src/pjlib-util/stun_simple.c
@@ -23,7 +23,7 @@
#include <pj/sock.h>
#include <pj/os.h>
-#define THIS_FILE "stun.c"
+#define THIS_FILE "stun_simple.c"
PJ_DEF(pj_status_t) pjstun_create_bind_req( pj_pool_t *pool,
void **msg, pj_size_t *len,
@@ -88,6 +88,7 @@ PJ_DEF(pj_status_t) pjstun_parse_msg( void *buf, pj_size_t len,
*attr = (pjstun_attr_hdr*)p_attr;
len = pj_ntohs((pj_uint16_t) ((*attr)->length)) + sizeof(pjstun_attr_hdr);
+ len = (len + 3) & ~3;
if (msg_len < len) {
PJ_LOG(4,(THIS_FILE, "Error: length mismatch in attr %d",