Message ID | 20230705180703.1469847-1-josimmon@redhat.com |
---|---|
State | New |
Headers | show |
Series | resolv/res_query: Add not indicating that alloca usage is safe. | expand |
On Wed, Jul 05, 2023 at 02:07:03PM -0400, Joe Simmons-Talbott wrote: > The buffer size is small (< 1024) and fixed sized so alloca is safe > here. Please disregard. There's a typo in the subject. I'll resend. Thanks, Joe > --- > resolv/res_query.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/resolv/res_query.c b/resolv/res_query.c > index 049de91b95..0e0e7be624 100644 > --- a/resolv/res_query.c > +++ b/resolv/res_query.c > @@ -117,6 +117,7 @@ __res_context_query (struct resolv_context *ctx, const char *name, > int n, use_malloc = 0; > > size_t bufsize = (type == T_QUERY_A_AND_AAAA ? 2 : 1) * QUERYSIZE; > + /* alloca is safe here since bufsize < 1024 and fixed sized. */ > u_char *buf = alloca (bufsize); > u_char *query1 = buf; > int nquery1 = -1; > -- > 2.39.2 >
diff --git a/resolv/res_query.c b/resolv/res_query.c index 049de91b95..0e0e7be624 100644 --- a/resolv/res_query.c +++ b/resolv/res_query.c @@ -117,6 +117,7 @@ __res_context_query (struct resolv_context *ctx, const char *name, int n, use_malloc = 0; size_t bufsize = (type == T_QUERY_A_AND_AAAA ? 2 : 1) * QUERYSIZE; + /* alloca is safe here since bufsize < 1024 and fixed sized. */ u_char *buf = alloca (bufsize); u_char *query1 = buf; int nquery1 = -1;