This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2][BZ 16852] Do not clobber recvmmsg argument.
- From: Rich Felker <dalias at libc dot org>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: Andreas Schwab <schwab at linux-m68k dot org>, libc-alpha at sourceware dot org
- Date: Mon, 28 Apr 2014 14:06:44 -0400
- Subject: Re: [PATCH v2][BZ 16852] Do not clobber recvmmsg argument.
- Authentication-results: sourceware.org; auth=none
- References: <20140428152937 dot GA1736 at domone dot podge> <87mwf5zcl3 dot fsf at igel dot home> <20140428160420 dot GA23142 at domone dot podge>
On Mon, Apr 28, 2014 at 06:04:20PM +0200, OndÅej BÃlka wrote:
> diff --git a/sysdeps/unix/sysv/linux/recvmmsg.c b/sysdeps/unix/sysv/linux/recvmmsg.c
> index 57ddf31..04a065f 100644
> --- a/sysdeps/unix/sysv/linux/recvmmsg.c
> +++ b/sysdeps/unix/sysv/linux/recvmmsg.c
> @@ -35,14 +35,16 @@
> #ifdef __NR_recvmmsg
> int
> recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
> - const struct timespec *tmo)
> + const struct timespec *_tmo)
> {
> + struct timespec tmo = *_tmo;
> +
This is invalid because a null tmo argument is allowed (and is in fact
the normal usage case). You have to check for it.
Rich