353. [bug] double incrememnt in lwrew/gethost.c:copytobuf().

(RT# 187)
This commit is contained in:
Mark Andrews 2000-07-26 22:52:01 +00:00
parent 0a7a0e19c4
commit c9b176a528
2 changed files with 5 additions and 4 deletions

View file

@ -1,3 +1,5 @@
353. [bug] double incrememnt in lwrew/gethost.c:copytobuf().
(RT# 187)
352. [bug] Race condition in dns_client_t startup could cause
an assertion failure.

View file

@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: gethost.c,v 1.20 2000/06/27 23:13:26 bwelling Exp $ */
/* $Id: gethost.c,v 1.21 2000/07/26 22:52:01 marka Exp $ */
#include <config.h>
@ -198,11 +198,10 @@ copytobuf(struct hostent *he, struct hostent *hptr, char *buf, int buflen) {
* Copy address list.
*/
hptr->h_addr_list = ptr;
for (i = 0; he->h_addr_list[i]; i++ , ptr++) {
for (i = 0; he->h_addr_list[i]; i++, ptr++) {
memcpy(cp, he->h_addr_list[i], n);
hptr->h_addr_list[i] = cp;
cp += n;
i++;
}
hptr->h_addr_list[i] = NULL;
ptr++;
@ -219,7 +218,7 @@ copytobuf(struct hostent *he, struct hostent *hptr, char *buf, int buflen) {
* Copy aliases.
*/
hptr->h_aliases = ptr;
for (i = 0 ; he->h_aliases[i]; i++) {
for (i = 0; he->h_aliases[i]; i++) {
n = strlen(he->h_aliases[i]) + 1;
strcpy(cp, he->h_aliases[i]);
hptr->h_aliases[i] = cp;