Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
This commit was generated by cvs2svn to compensate for changes in r46154,
[fs/lustre-release.git]
/
libsysio
/
src
/
rw.c
diff --git
a/libsysio/src/rw.c
b/libsysio/src/rw.c
index
edc308b
..
bd4ae6b
100644
(file)
--- a/
libsysio/src/rw.c
+++ b/
libsysio/src/rw.c
@@
-682,9
+682,13
@@
PREPEND(_, SYSIO_INTERFACE_NAME(ireadx))(int fd,
SYSIO_INTERFACE_ENTER;
fil = _sysio_fd_find(fd);
SYSIO_INTERFACE_ENTER;
fil = _sysio_fd_find(fd);
- if (!
(fil && xtv_count)
)
+ if (!
fil
)
SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF);
SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF);
+ /* Perform a check on the iov_count and xtv_count */
+ if ((iov_count == 0) || (xtv_count == 0))
+ SYSIO_INTERFACE_RETURN(IOID_FAIL, -EINVAL);
+
err =
_sysio_iiox(IIOXOP_READ(fil->f_ino),
fil,
err =
_sysio_iiox(IIOXOP_READ(fil->f_ino),
fil,
@@
-717,9
+721,14
@@
SYSIO_INTERFACE_NAME(ireadx)(int fd,
SYSIO_INTERFACE_ENTER;
fil = _sysio_fd_find(fd);
SYSIO_INTERFACE_ENTER;
fil = _sysio_fd_find(fd);
- if (!
(fil && xtv_count)
)
+ if (!
fil
)
SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF);
SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF);
+
+ /* Perform a check on the iov_count and xtv_count */
+ if ((iov_count == 0) || (xtv_count == 0))
+ SYSIO_INTERFACE_RETURN(IOID_FAIL, -EINVAL);
+
ixtv = ixtvent = malloc(xtv_count * sizeof(struct intnl_xtvec));
if (!ixtv)
SYSIO_INTERFACE_RETURN(IOID_FAIL, -ENOMEM);
ixtv = ixtvent = malloc(xtv_count * sizeof(struct intnl_xtvec));
if (!ixtv)
SYSIO_INTERFACE_RETURN(IOID_FAIL, -ENOMEM);
@@
-1236,9
+1245,13
@@
SYSIO_INTERFACE_NAME(iwritex)(int fd,
SYSIO_INTERFACE_ENTER;
fil = _sysio_fd_find(fd);
SYSIO_INTERFACE_ENTER;
fil = _sysio_fd_find(fd);
- if (!
(fil && xtv_count)
)
+ if (!
fil
)
SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF);
SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF);
+ /* Perform a check on the iov_count and xtv_count */
+ if ((iov_count == 0) || (xtv_count == 0))
+ SYSIO_INTERFACE_RETURN(IOID_FAIL, -EINVAL);
+
ixtv = ixtvent = malloc(xtv_count * sizeof(struct intnl_xtvec));
if (!ixtv)
SYSIO_INTERFACE_RETURN(IOID_FAIL, -ENOMEM);
ixtv = ixtvent = malloc(xtv_count * sizeof(struct intnl_xtvec));
if (!ixtv)
SYSIO_INTERFACE_RETURN(IOID_FAIL, -ENOMEM);