Loading ares/ares__get_hostent.c +5 −4 Original line number Diff line number Diff line Loading @@ -38,10 +38,10 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host) { char *line = NULL, *p, *q, **alias; char *txtaddr, *txthost, *txtalias; int status, linesize, addrfam, naliases; int status, addrfam; size_t addrlen, linesize, naliases; struct in_addr addr; struct in6_addr addr6; size_t addrlen; struct hostent *hostent = NULL; *host = NULL; /* Assume failure */ Loading Loading @@ -194,12 +194,13 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host) memcpy(hostent->h_addr_list[0], &addr6, sizeof(struct in6_addr)); /* Copy aliases. */ hostent->h_aliases = malloc((((size_t)naliases) + 1) * sizeof(char *)); hostent->h_aliases = malloc((naliases + 1) * sizeof(char *)); if (!hostent->h_aliases) break; alias = hostent->h_aliases; while (naliases >= 0) while (naliases) *(alias + naliases--) = NULL; *alias = NULL; while (txtalias) { p = txtalias; Loading ares/ares__read_line.c +2 −2 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ * appropriate. The initial value of *buf should be NULL. After the * calling routine is done reading lines, it should free *buf. */ int ares__read_line(FILE *fp, char **buf, int *bufsize) int ares__read_line(FILE *fp, char **buf, size_t *bufsize) { char *newbuf; size_t offset = 0; Loading @@ -46,7 +46,7 @@ int ares__read_line(FILE *fp, char **buf, int *bufsize) while (1) { if (!fgets(*buf + offset, *bufsize - (int)offset, fp)) if (!fgets(*buf + offset, *bufsize - offset, fp)) return (offset != 0) ? 0 : (ferror(fp)) ? ARES_EFILE : ARES_EOF; len = offset + strlen(*buf + offset); if ((*buf)[len - 1] == '\n') Loading ares/ares_init.c +1 −1 Original line number Diff line number Diff line Loading @@ -809,7 +809,7 @@ DhcpNameServer { char *p; FILE *fp; int linesize; size_t linesize; int error; /* Don't read resolv.conf and friends if we don't have to */ Loading ares/ares_private.h +1 −1 Original line number Diff line number Diff line Loading @@ -312,7 +312,7 @@ void ares__send_query(ares_channel channel, struct query *query, struct timeval *now); void ares__close_sockets(ares_channel channel, struct server_state *server); int ares__get_hostent(FILE *fp, int family, struct hostent **host); int ares__read_line(FILE *fp, char **buf, int *bufsize); int ares__read_line(FILE *fp, char **buf, size_t *bufsize); void ares__free_query(struct query *query); unsigned short ares__generate_new_id(rc4_key* key); struct timeval ares__tvnow(void); Loading ares/ares_search.c +2 −1 Original line number Diff line number Diff line Loading @@ -238,7 +238,8 @@ static int single_domain(ares_channel channel, const char *name, char **s) const char *hostaliases; FILE *fp; char *line = NULL; int linesize, status; int status; size_t linesize; const char *p, *q; int error; Loading Loading
ares/ares__get_hostent.c +5 −4 Original line number Diff line number Diff line Loading @@ -38,10 +38,10 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host) { char *line = NULL, *p, *q, **alias; char *txtaddr, *txthost, *txtalias; int status, linesize, addrfam, naliases; int status, addrfam; size_t addrlen, linesize, naliases; struct in_addr addr; struct in6_addr addr6; size_t addrlen; struct hostent *hostent = NULL; *host = NULL; /* Assume failure */ Loading Loading @@ -194,12 +194,13 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host) memcpy(hostent->h_addr_list[0], &addr6, sizeof(struct in6_addr)); /* Copy aliases. */ hostent->h_aliases = malloc((((size_t)naliases) + 1) * sizeof(char *)); hostent->h_aliases = malloc((naliases + 1) * sizeof(char *)); if (!hostent->h_aliases) break; alias = hostent->h_aliases; while (naliases >= 0) while (naliases) *(alias + naliases--) = NULL; *alias = NULL; while (txtalias) { p = txtalias; Loading
ares/ares__read_line.c +2 −2 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ * appropriate. The initial value of *buf should be NULL. After the * calling routine is done reading lines, it should free *buf. */ int ares__read_line(FILE *fp, char **buf, int *bufsize) int ares__read_line(FILE *fp, char **buf, size_t *bufsize) { char *newbuf; size_t offset = 0; Loading @@ -46,7 +46,7 @@ int ares__read_line(FILE *fp, char **buf, int *bufsize) while (1) { if (!fgets(*buf + offset, *bufsize - (int)offset, fp)) if (!fgets(*buf + offset, *bufsize - offset, fp)) return (offset != 0) ? 0 : (ferror(fp)) ? ARES_EFILE : ARES_EOF; len = offset + strlen(*buf + offset); if ((*buf)[len - 1] == '\n') Loading
ares/ares_init.c +1 −1 Original line number Diff line number Diff line Loading @@ -809,7 +809,7 @@ DhcpNameServer { char *p; FILE *fp; int linesize; size_t linesize; int error; /* Don't read resolv.conf and friends if we don't have to */ Loading
ares/ares_private.h +1 −1 Original line number Diff line number Diff line Loading @@ -312,7 +312,7 @@ void ares__send_query(ares_channel channel, struct query *query, struct timeval *now); void ares__close_sockets(ares_channel channel, struct server_state *server); int ares__get_hostent(FILE *fp, int family, struct hostent **host); int ares__read_line(FILE *fp, char **buf, int *bufsize); int ares__read_line(FILE *fp, char **buf, size_t *bufsize); void ares__free_query(struct query *query); unsigned short ares__generate_new_id(rc4_key* key); struct timeval ares__tvnow(void); Loading
ares/ares_search.c +2 −1 Original line number Diff line number Diff line Loading @@ -238,7 +238,8 @@ static int single_domain(ares_channel channel, const char *name, char **s) const char *hostaliases; FILE *fp; char *line = NULL; int linesize, status; int status; size_t linesize; const char *p, *q; int error; Loading