You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
writev() uses struct iovec which has iov_base and iov_len members.
In Linux writev() permits bad address in iov_base in case of zero iov_len value.
In WSL writev() generates an error in this case. iov_len must be checked against zero before iov_base should be valid.
I found this case in debugging of CMake's configure_file which calls eventually ofstream::write(buf,siz) where siz is 1024 or more.
#include<sys/uio.h>// for writev & struct iov#include<stdio.h>// for perrorintmain()
{
structioveciov= {0,0};
if (writev(2, &iov, 1) <0)
perror("writev() error: ");
}
The text was updated successfully, but these errors were encountered:
Thanks for reporting this, this was also reported in #238 and #272. I'm going to go ahead and close this out because it's being tracked by the other two issues.
writev()
usesstruct iovec
which hasiov_base
andiov_len
members.In Linux
writev()
permits bad address iniov_base
in case of zeroiov_len
value.In WSL
writev()
generates an error in this case.iov_len
must be checked against zero beforeiov_base
should be valid.I found this case in debugging of CMake's configure_file which calls eventually
ofstream::write(buf,siz)
where siz is 1024 or more.The text was updated successfully, but these errors were encountered: