[PATCH v2 1/1] pcapng: warn if NULL is passed to rte_pcapng_close

Dmitry Kozlyuk dmitry.kozliuk at gmail.com
Sun Feb 23 23:04:04 CET 2025


2025-02-23 22:41 (UTC+0100), Ariel Otilibili:
> diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
> index 16485b27cb46..d2cbcea42885 100644
> --- a/lib/pcapng/rte_pcapng.c
> +++ b/lib/pcapng/rte_pcapng.c
> @@ -716,6 +716,9 @@ rte_pcapng_fdopen(int fd,
>  void
>  rte_pcapng_close(rte_pcapng_t *self)
>  {
> +	if (!self)
> +		rte_errno = EINVAL;
> +
>  	close(self->outfd);
>  	free(self);
>  }

Still dereferencing self == NULL.


More information about the stable mailing list