Index: higher.c =================================================================== --- higher.c (revision 3150) +++ higher.c (revision 3151) @@ -198,7 +198,7 @@ break; } } - strncpy(addr, word, LDNS_IP6ADDRLEN); + strlcpy(addr, word, LDNS_MAX_LINELEN+1); } else { /* la al la la */ if (ip6) { Index: packet.c =================================================================== --- packet.c (revision 3150) +++ packet.c (revision 3151) @@ -456,17 +456,12 @@ { uint16_t rid = 0; #ifdef HAVE_SSL - unsigned char *rb; - rb = LDNS_XMALLOC(unsigned char, 2); - if (RAND_bytes(rb, 2) == 1) { - rid = ldns_read_uint16(rb); - } - LDNS_FREE(rb); -#endif - if (rid == 0) { + if (RAND_bytes((unsigned char*)&rid, 2) != 1) { rid = (uint16_t) random(); } - +#else + rid = (uint16_t) random(); +#endif ldns_pkt_set_id(packet, rid); } Index: net.c =================================================================== --- net.c (revision 3150) +++ net.c (revision 3151) @@ -652,6 +652,8 @@ if (!data) { return NULL; } + /* zero the structure for portability */ + memset(data, 0, sizeof(struct sockaddr_storage)); if (port == 0) { port = LDNS_PORT; }