- Timestamp:
- Apr 4, 2007 5:29:36 PM (18 years ago)
- Location:
- pjproject/trunk/pjnath
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/include/pjnath/stun_msg.h
r1126 r1150 286 286 PJ_STUN_ATTR_REFLECTED_FROM = 0x000B,/**< REFLECTED-FROM (deprecatd)*/ 287 287 PJ_STUN_ATTR_LIFETIME = 0x000D,/**< LIFETIME attribute. */ 288 PJ_STUN_ATTR_MAGIC_COOKIE = 0x000F,/**< MAGIC-COOKIE attr (deprec)*/ 288 289 PJ_STUN_ATTR_BANDWIDTH = 0x0010,/**< BANDWIDTH attribute */ 289 290 PJ_STUN_ATTR_REMOTE_ADDR = 0x0012,/**< REMOTE-ADDRESS attribute */ -
pjproject/trunk/pjnath/src/pjnath/errno.c
r1141 r1150 135 135 pj_str_t errstr; 136 136 137 buf[bufsize-1] = '\0'; 138 137 139 if (cmsg.slen == 0) { 138 140 /* Not found */ … … 144 146 errstr.ptr = buf; 145 147 pj_strncpy(&errstr, &cmsg, bufsize); 148 if (errstr.slen < (int)bufsize) 149 buf[errstr.slen] = '\0'; 150 else 151 buf[bufsize-1] = '\0'; 146 152 } 147 153 -
pjproject/trunk/pjnath/src/pjnath/stun_msg.c
r1141 r1150 233 233 }, 234 234 { 235 /* ID 0x000F is not assigned*/236 NULL,237 NULL,238 NULL235 /* PJ_STUN_ATTR_MAGIC_COOKIE */ 236 "MAGIC-COOKIE", 237 &decode_uint_attr, 238 &encode_uint_attr 239 239 }, 240 240 { … … 1773 1773 /* Parse attributes */ 1774 1774 uattr_cnt = 0; 1775 while (pdu_len > 0) {1775 while (pdu_len >= 4) { 1776 1776 unsigned attr_type, attr_val_len; 1777 1777 const struct attr_desc *adesc; … … 1780 1780 * to 4 bytes boundary, add padding. 1781 1781 */ 1782 attr_type = pj_ntohs(*(pj_uint16_t*)pdu);1783 attr_val_len = pj_ntohs(*(pj_uint16_t*)(pdu+2));1782 attr_type = GETVAL16H(pdu, 0); 1783 attr_val_len = GETVAL16H(pdu, 2); 1784 1784 attr_val_len = (attr_val_len + 3) & (~3); 1785 1785 … … 1920 1920 } 1921 1921 1922 pdu += (attr_val_len + 4); 1923 pdu_len -= (attr_val_len + 4); 1922 if (attr_val_len + 4 >= pdu_len) { 1923 pdu += pdu_len; 1924 pdu_len = 0; 1925 } else { 1926 pdu += (attr_val_len + 4); 1927 pdu_len -= (attr_val_len + 4); 1928 } 1929 } 1930 1931 if (pdu_len > 0) { 1932 /* Stray trailing bytes */ 1933 PJ_LOG(4,(THIS_FILE, 1934 "Error decoding STUN message: unparsed trailing %d bytes", 1935 pdu_len)); 1936 return PJNATH_EINSTUNMSGLEN; 1924 1937 } 1925 1938 -
pjproject/trunk/pjnath/src/pjstun-client/client_main.c
r1149 r1150 185 185 status = pj_init(); 186 186 status = pjlib_util_init(); 187 status = pjnath_init(); 187 188 188 189 pj_caching_pool_init(&g.cp, &pj_pool_factory_default_policy, 0);
Note: See TracChangeset
for help on using the changeset viewer.