RE: [PATCH v3 4/5] pcapng: avoid using alloca()

2023-11-09 Thread Morten Brørup
> From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Thursday, 9 November 2023 16.45 > > On Thu, 9 Nov 2023 09:21:22 +0100 > Morten Brørup wrote: > > > I can't find the definition of BUFSIZ. Please make sure to add a > comment to the definition of BUFSIZ mentioning - like in you

RE: [PATCH v3 4/5] pcapng: avoid using alloca()

2023-11-09 Thread Morten Brørup
> From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Wednesday, 8 November 2023 19.36 > > The function alloca() like VLA's has problems if the caller > passes a large value. Instead use a fixed size buffer (4K) > which will be more than sufficient for the info related blocks > in

[PATCH v3 4/5] pcapng: avoid using alloca()

2023-11-08 Thread Stephen Hemminger
The function alloca() like VLA's has problems if the caller passes a large value. Instead use a fixed size buffer (4K) which will be more than sufficient for the info related blocks in the file. Add bounds checks as well. Signed-off-by: Stephen Hemminger --- lib/pcapng/rte_pcapng.c | 34