if (!ML_(fd_allowed)(ARG1, "readv", tid, False)) {
SET_STATUS_Failure( VKI_EBADF );
} else {
- PRE_MEM_READ( "readv(vector)", ARG2, ARG3 * sizeof(struct vki_iovec) );
+ if ((Int)ARG3 >= 0)
+ PRE_MEM_READ( "readv(vector)", ARG2, ARG3 * sizeof(struct vki_iovec) );
if (ARG2 != 0) {
/* ToDo: don't do any of the following if the vector is invalid */
if (!ML_(fd_allowed)(ARG1, "writev", tid, False)) {
SET_STATUS_Failure( VKI_EBADF );
} else {
- PRE_MEM_READ( "writev(vector)",
- ARG2, ARG3 * sizeof(struct vki_iovec) );
+ if ((Int)ARG3 >= 0)
+ PRE_MEM_READ( "writev(vector)",
+ ARG2, ARG3 * sizeof(struct vki_iovec) );
if (ARG2 != 0) {
/* ToDo: don't do any of the following if the vector is invalid */
vec = (struct vki_iovec *)ARG2;
fprintf(stderr, "expected errno = EINVAL, got %d\n", errno);
}
else
- fprintf(stderr, "Error writev returned a positive value\n");
+ fprintf(stderr, "Error readv returned a positive value\n");
unlink(f_name);
Address 0x........ is not stack'd, malloc'd or (recently) free'd
Received EFAULT as expected
-Syscall param writev(vector) points to unaddressable byte(s)
- ...
- by 0x........: main (writev1.c:68)
- Address 0x........ is not stack'd, malloc'd or (recently) free'd
-
Received EINVAL as expected
-Syscall param readv(vector) points to unaddressable byte(s)
- ...
- by 0x........: main (writev1.c:76)
- Address 0x........ is not stack'd, malloc'd or (recently) free'd
-
Received EINVAL as expected