[27530] in Source-Commits
python-afs commit: Use sizeof() in pioctl_write()
daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Tue Nov 12 18:27:57 2013
Date: Tue, 12 Nov 2013 18:27:50 -0500
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201311122327.rACNRosm018764@drugstore.mit.edu>
To: source-commits@MIT.EDU
https://github.com/mit-athena/python-afs/commits/279058d892ad8bfccbe4c29c78f524e6cb4fb40c
commit 279058d892ad8bfccbe4c29c78f524e6cb4fb40c
Author: Jonathan Reed <jdreed@mit.edu>
Date: Wed Oct 30 14:35:08 2013 -0400
Use sizeof() in pioctl_write()
Don't assume that outbuffer is AFS_PIOCTL_MAXSIZE, just call
sizeof() and let the lower layer deal.
afs/_util.pyx | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/afs/_util.pyx b/afs/_util.pyx
index 4879e86..99c0609 100644
--- a/afs/_util.pyx
+++ b/afs/_util.pyx
@@ -51,7 +51,7 @@ cdef extern int pioctl_write(char *path, afs_int32 op, char *inbuffer,
log.debug("No output desired from pioctl_write()")
blob.out_size = 0
else:
- blob.out_size = AFS_PIOCTL_MAXSIZE
+ blob.out_size = sizeof(outbuffer)
blob.out = outbuffer
code = pioctl(path, op, &blob, follow)
log.debug("pioctl_write() returned %d", code)