This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2][BZ 16852] Do not clobber recvmmsg argument.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]