We use some uio structures that were allocated on the stack, but we
only initialize them by initializing individual fields. On some
platforms (Solaris is one known example, but probably not the only
one), there are additional fields we do not initialize. Since we
cannot be certain of what any additional fields there may be, just
zero the whole thing.
This is basically the same change as
I0eae0b49a70aee19f3a9ec118b03cfb3a6bd03a3, but in the rx subtree.
Reviewed-on: http://gerrit.openafs.org/11711
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
(cherry picked from commit
a762e6871ad6837ee126cec9e63d99388b4bf119)
Change-Id: Ie6a2cce500d6a0a7a09c305296f4b34d122d3108
Reviewed-on: http://gerrit.openafs.org/11714
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
osi_NetReceive(osi_socket so, struct sockaddr_in *addr, struct iovec *dvec,
int nvecs, int *alength)
{
+ int i;
+ struct iovec iov[RX_MAXIOVECS];
+ struct sockaddr *sa = NULL;
+ int code;
+ size_t resid;
+
+ int haveGlock = ISAFS_GLOCK();
+
#ifdef AFS_DARWIN80_ENV
socket_t asocket = (socket_t)so;
struct msghdr msg;
#else
struct socket *asocket = (struct socket *)so;
struct uio u;
+ memset(&u, 0, sizeof(u));
#endif
- int i;
- struct iovec iov[RX_MAXIOVECS];
- struct sockaddr *sa = NULL;
- int code;
- size_t resid;
-
- int haveGlock = ISAFS_GLOCK();
+ memset(&iov, 0, sizeof(iov));
/*AFS_STATCNT(osi_NetReceive); */
if (nvecs > RX_MAXIOVECS)
osi_NetSend(osi_socket so, struct sockaddr_in *addr, struct iovec *dvec,
int nvecs, afs_int32 alength, int istack)
{
+ afs_int32 code;
+ int i;
+ struct iovec iov[RX_MAXIOVECS];
+ int haveGlock = ISAFS_GLOCK();
#ifdef AFS_DARWIN80_ENV
socket_t asocket = (socket_t)so;
struct msghdr msg;
#else
struct socket *asocket = (struct socket *)so;
struct uio u;
+ memset(&u, 0, sizeof(u));
#endif
- afs_int32 code;
- int i;
- struct iovec iov[RX_MAXIOVECS];
- int haveGlock = ISAFS_GLOCK();
+ memset(&iov, 0, sizeof(iov));
AFS_STATCNT(osi_NetSend);
if (nvecs > RX_MAXIOVECS)
int code;
int haveGlock = ISAFS_GLOCK();
+
+ memset(&u, 0, sizeof(u));
+ memset(&iov, 0, sizeof(iov));
+
/*AFS_STATCNT(osi_NetReceive); */
if (nvecs > RX_MAXIOVECS)
struct uio u;
int haveGlock = ISAFS_GLOCK();
+ memset(&u, 0, sizeof(u));
+ memset(&iov, 0, sizeof(iov));
+
AFS_STATCNT(osi_NetSend);
if (nvecs > RX_MAXIOVECS)
osi_Panic("osi_NetSend: %d: Too many iovecs.\n", nvecs);
int code;
int size = sizeof(struct sockaddr_in);
+ memset(&uio, 0, sizeof(uio));
+ memset(&temp, 0, sizeof(temp));
+
/* Guess based on rxk_NewSocket */
bp = allocb((size + SO_MSGOFFSET + 1), BPRI_MED);
if (!bp)
int flags = 0;
MBLKP bp, sp;
+ memset(&tuio, 0, sizeof(tuio));
+ memset(&tmpvec, 0, sizeof(tempvec));
+
if (nvecs > RX_MAXWVECS + 2) {
osi_Panic("Too many (%d) iovecs passed to osi_NetReceive\n", nvecs);
}
BHV_PDATA(&bhv) = (void *)so;
#endif
+ memset(&tuio, 0, sizeof(tuio));
+ memset(&tmpvec, 0, sizeof(tmpvec));
+
tuio.uio_iov = tmpvec;
tuio.uio_iovcnt = nvecs;
tuio.uio_offset = 0;
int i;
bhv_desc_t bhv;
+ memset(&tuio, 0, sizeof(tuio));
+ memset(&tvecs, 0, sizeof(tvecs));
+
if (nvec > RX_MAXWVECS + 1) {
osi_Panic("osi_NetSend: %d: Too many iovecs.\n", nvec);
}
int glocked = ISAFS_GLOCK();
+ memset(&u, 0, sizeof(u));
+ memset(&iov, 0, sizeof(iov));
+
if (nvecs > RX_MAXIOVECS)
osi_Panic("osi_NetReceive: %d: too many iovecs\n", nvecs);
struct mbuf *nam;
int glocked = ISAFS_GLOCK();
+ memset(&u, 0, sizeof(u));
+ memset(&iov, 0, sizeof(iov));
+
AFS_STATCNT(osi_NetSend);
if (nvecs > RX_MAXIOVECS)
osi_Panic("osi_NetSend: %d: Too many iovecs.\n", nvecs);
int haveGlock = ISAFS_GLOCK();
+ memset(&u, 0, sizeof(u));
+ memset(&iov, 0, sizeof(iov));
+
if (nvecs > RX_MAXIOVECS)
osi_Panic("osi_NetReceive: %d: too many iovecs\n", nvecs);
struct mbuf *nam;
int haveGlock = ISAFS_GLOCK();
+ memset(&u, 0, sizeof(u));
+ memset(&iov, 0, sizeof(iov));
+
AFS_STATCNT(osi_NetSend);
if (nvecs > RX_MAXIOVECS)
osi_Panic("osi_NetSend: %d: Too many iovecs.\n", nvecs);
int error;
int i;
+ memset(&uio, 0, sizeof(uio));
+ memset(&iov, 0, sizeof(iov));
+
if (nvecs > RX_MAXIOVECS) {
osi_Panic("osi_NetSend: %d: Too many iovecs.\n", nvecs);
}
int error;
int i;
+ memset(&uio, 0, sizeof(uio));
+ memset(&iov, 0, sizeof(iov));
+
if (nvecs > RX_MAXIOVECS) {
osi_Panic("osi_NetSend: %d: Too many iovecs.\n", nvecs);
}