|
|
b9ba6d |
diff -rup a/nscd/nscd_getserv_r.c b/nscd/nscd_getserv_r.c
|
|
|
b9ba6d |
--- a/nscd/nscd_getserv_r.c 2012-04-04 16:37:27.873951850 -0600
|
|
|
b9ba6d |
+++ b/nscd/nscd_getserv_r.c 2012-04-04 16:37:49.904837348 -0600
|
|
|
b9ba6d |
@@ -124,6 +123,7 @@ nscd_getserv_r (const char *crit, size_t
|
|
|
b9ba6d |
s_name = (char *) (&found->data[0].servdata + 1);
|
|
|
b9ba6d |
serv_resp = found->data[0].servdata;
|
|
|
b9ba6d |
s_proto = s_name + serv_resp.s_name_len;
|
|
|
b9ba6d |
+ alloca_aliases_len = 1;
|
|
|
b9ba6d |
aliases_len = (uint32_t *) (s_proto + serv_resp.s_proto_len);
|
|
|
b9ba6d |
aliases_list = ((char *) aliases_len
|
|
|
b9ba6d |
+ serv_resp.s_aliases_cnt * sizeof (uint32_t));
|
|
|
b9ba6d |
@@ -154,7 +154,9 @@ nscd_getserv_r (const char *crit, size_t
|
|
|
b9ba6d |
+ (serv_resp.s_aliases_cnt
|
|
|
b9ba6d |
* sizeof (uint32_t)));
|
|
|
b9ba6d |
if (alloca_aliases_len)
|
|
|
b9ba6d |
- tmp = __alloca (serv_resp.s_aliases_cnt * sizeof (uint32_t));
|
|
|
b9ba6d |
+ tmp = alloca_account (serv_resp.s_aliases_cnt
|
|
|
b9ba6d |
+ * sizeof (uint32_t),
|
|
|
b9ba6d |
+ alloca_used);
|
|
|
b9ba6d |
else
|
|
|
b9ba6d |
{
|
|
|
b9ba6d |
tmp = malloc (serv_resp.s_aliases_cnt * sizeof (uint32_t));
|
|
|
b9ba6d |
@@ -249,8 +251,9 @@ nscd_getserv_r (const char *crit, size_t
|
|
|
b9ba6d |
+ (serv_resp.s_aliases_cnt
|
|
|
b9ba6d |
* sizeof (uint32_t)));
|
|
|
b9ba6d |
if (alloca_aliases_len)
|
|
|
b9ba6d |
- aliases_len = alloca (serv_resp.s_aliases_cnt
|
|
|
b9ba6d |
- * sizeof (uint32_t));
|
|
|
b9ba6d |
+ aliases_len = alloca_account (serv_resp.s_aliases_cnt
|
|
|
b9ba6d |
+ * sizeof (uint32_t),
|
|
|
b9ba6d |
+ alloca_used);
|
|
|
b9ba6d |
else
|
|
|
b9ba6d |
{
|
|
|
b9ba6d |
aliases_len = malloc (serv_resp.s_aliases_cnt
|
|
|
b9ba6d |
@@ -368,7 +371,11 @@ nscd_getserv_r (const char *crit, size_t
|
|
|
b9ba6d |
}
|
|
|
b9ba6d |
|
|
|
b9ba6d |
if (retval != -1)
|
|
|
b9ba6d |
- goto retry;
|
|
|
b9ba6d |
+ {
|
|
|
b9ba6d |
+ if (!alloca_aliases_len)
|
|
|
b9ba6d |
+ free ((void *) aliases_len);
|
|
|
b9ba6d |
+ goto retry;
|
|
|
b9ba6d |
+ }
|
|
|
b9ba6d |
}
|
|
|
b9ba6d |
|
|
|
b9ba6d |
if (!alloca_aliases_len)
|