Date: Mon, 21 Nov 2016 10:47:38 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308919 - stable/10/sys/kern Message-ID: <201611211047.uALAlc2l002901@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Nov 21 10:47:38 2016 New Revision: 308919 URL: https://svnweb.freebsd.org/changeset/base/308919 Log: MFC r308642: Initialize reserved bytes in struct mq_attr. PR: 214488 Modified: stable/10/sys/kern/uipc_mqueue.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/uipc_mqueue.c ============================================================================== --- stable/10/sys/kern/uipc_mqueue.c Mon Nov 21 10:44:40 2016 (r308918) +++ stable/10/sys/kern/uipc_mqueue.c Mon Nov 21 10:47:38 2016 (r308919) @@ -2186,10 +2186,10 @@ sys_kmq_setattr(struct thread *td, struc } error = kern_kmq_setattr(td, uap->mqd, uap->attr != NULL ? &attr : NULL, &oattr); - if (error != 0) - return (error); - if (uap->oattr != NULL) + if (error == 0 && uap->oattr != NULL) { + bzero(oattr.__reserved, sizeof(oattr.__reserved)); error = copyout(&oattr, uap->oattr, sizeof(oattr)); + } return (error); } @@ -2723,10 +2723,9 @@ freebsd32_kmq_setattr(struct thread *td, } error = kern_kmq_setattr(td, uap->mqd, uap->attr != NULL ? &attr : NULL, &oattr); - if (error != 0) - return (error); - if (uap->oattr != NULL) { + if (error == 0 && uap->oattr != NULL) { mq_attr_to32(&oattr, &oattr32); + bzero(oattr32.__reserved, sizeof(oattr32.__reserved)); error = copyout(&oattr32, uap->oattr, sizeof(oattr32)); } return (error);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611211047.uALAlc2l002901>