Changeset 5146 for pjproject/trunk/pjlib/src/pj/addr_resolv_sock.c
- Timestamp:
- Aug 5, 2015 6:31:45 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/addr_resolv_sock.c
r3553 r5146 130 130 for (idx = 0; idx < naddr && i < *count; idx++) { 131 131 struct sockaddr *addr; 132 size_t addr_size; 132 133 133 134 addr = (struct sockaddr *) … … 144 145 145 146 /* Store address */ 146 PJ_ASSERT_ON_FAIL(sizeof(*addr) <= sizeof(pj_sockaddr), 147 continue); 148 pj_memcpy(&ai[i].ai_addr, addr, sizeof(*addr)); 147 addr_size = sizeof(*addr); 148 if (af == PJ_AF_INET6) { 149 addr_size = addr->sa_len; 150 } 151 PJ_ASSERT_ON_FAIL(addr_size <= sizeof(pj_sockaddr), continue); 152 pj_memcpy(&ai[i].ai_addr, addr, addr_size); 149 153 PJ_SOCKADDR_RESET_LEN(&ai[i].ai_addr); 150 154
Note: See TracChangeset
for help on using the changeset viewer.