mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-26 04:31:03 +00:00
resolv/nss_dns/dns-host: Get rid of alloca.
Since the alloca is a small constant size use an array instead. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
This commit is contained in:
parent
1b214630ce
commit
648b832600
@ -378,6 +378,7 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
|
||||
int *herrnop, int32_t *ttlp)
|
||||
{
|
||||
enum nss_status status = check_name (name, herrnop);
|
||||
char tmp[NS_MAXDNAME];
|
||||
if (status != NSS_STATUS_SUCCESS)
|
||||
return status;
|
||||
struct resolv_context *ctx = __resolv_context_get ();
|
||||
@ -395,8 +396,7 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
|
||||
*/
|
||||
if (strchr (name, '.') == NULL)
|
||||
{
|
||||
char *tmp = alloca (NS_MAXDNAME);
|
||||
const char *cp = __res_context_hostalias (ctx, name, tmp, NS_MAXDNAME);
|
||||
const char *cp = __res_context_hostalias (ctx, name, tmp, sizeof (tmp));
|
||||
if (cp != NULL)
|
||||
name = cp;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user