From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 13CBA385841E; Tue, 15 Mar 2022 18:38:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13CBA385841E Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] posix: Remove alloca_account usage on getaddrinfo X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: d785ddf39368679da8b6d2696ea702a3473b68b3 X-Git-Newrev: 41ca2b14515a2808e6a7f80a464abc0f0a222d9b Message-Id: <20220315183825.13CBA385841E@sourceware.org> Date: Tue, 15 Mar 2022 18:38:25 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2022 18:38:25 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=41ca2b14515a2808e6a7f80a464abc0f0a222d9b commit 41ca2b14515a2808e6a7f80a464abc0f0a222d9b Author: Adhemerval Zanella Date: Wed Mar 9 18:31:30 2022 -0300 posix: Remove alloca_account usage on getaddrinfo Diff: --- sysdeps/posix/getaddrinfo.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 13372e8d47..f22c36a262 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -336,10 +336,6 @@ gaih_inet (const char *name, const struct gaih_service *service, const char *canon = NULL; const char *orig_name = name; - /* Reserve stack memory for the scratch buffer in the getaddrinfo - function. */ - size_t alloca_used = sizeof (struct scratch_buffer); - if (req->ai_protocol || req->ai_socktype) { ++tp; @@ -371,7 +367,7 @@ gaih_inet (const char *name, const struct gaih_service *service, if (tp->name[0]) { st = (struct gaih_servtuple *) - alloca_account (sizeof (struct gaih_servtuple), alloca_used); + alloca (sizeof (struct gaih_servtuple)); int rc = gaih_inet_serv (service->name, tp, req, st, tmpbuf); if (__glibc_unlikely (rc != 0)) @@ -396,8 +392,7 @@ gaih_inet (const char *name, const struct gaih_service *service, continue; newp = (struct gaih_servtuple *) - alloca_account (sizeof (struct gaih_servtuple), - alloca_used); + alloca (sizeof (struct gaih_servtuple)); if (gaih_inet_serv (service->name, tp, req, newp, tmpbuf) != 0) @@ -422,7 +417,7 @@ gaih_inet (const char *name, const struct gaih_service *service, if (req->ai_socktype || req->ai_protocol) { - st = alloca_account (sizeof (struct gaih_servtuple), alloca_used); + st = alloca (sizeof (struct gaih_servtuple)); st->next = NULL; st->socktype = tp->socktype; st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY) @@ -439,8 +434,7 @@ gaih_inet (const char *name, const struct gaih_service *service, { struct gaih_servtuple *newp; - newp = alloca_account (sizeof (struct gaih_servtuple), - alloca_used); + newp = alloca (sizeof (struct gaih_servtuple)); newp->next = NULL; newp->socktype = tp->socktype; newp->protocol = tp->protocol; @@ -459,7 +453,7 @@ gaih_inet (const char *name, const struct gaih_service *service, if (name != NULL) { - at = alloca_account (sizeof (struct gaih_addrtuple), alloca_used); + at = alloca (sizeof (struct gaih_addrtuple)); at->family = AF_UNSPEC; at->scopeid = 0; at->next = NULL; @@ -940,7 +934,7 @@ gaih_inet (const char *name, const struct gaih_service *service, else { struct gaih_addrtuple *atr; - atr = at = alloca_account (sizeof (struct gaih_addrtuple), alloca_used); + atr = at = alloca (sizeof (struct gaih_addrtuple)); memset (at, '\0', sizeof (struct gaih_addrtuple)); if (req->ai_family == AF_UNSPEC)