1
0
mirror of https://frontier.innolan.net/rainlance/c-ares.git synced 2025-11-22 07:29:28 +00:00

Fixed an OOM condition reported by Jim Meyering

This commit is contained in:
Daniel Stenberg
2008-11-15 23:07:35 +00:00
parent f75e379dae
commit 54056b2063

View File

@ -125,8 +125,15 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
}
strncpy(aliases[aliascnt], rr_data, strlen(rr_data)+1);
aliascnt++;
if ((aliascnt%8)==0)
aliases = realloc(aliases, (aliascnt/16+1) * sizeof(char *));
if ((aliascnt%8)==0) {
char **ptr;
ptr = realloc(aliases, (aliascnt/16+1) * sizeof(char *));
if(!ptr) {
status = ARES_ENOMEM;
break;
}
aliases = ptr;
}
}
if (rr_class == C_IN && rr_type == T_CNAME)