* winsup.h (__check_null_invalid_struct): Make ptr argument non-const.
(__check_null_invalid_struct_errno): Ditto. * miscfuncs.cc (__check_null_invalid_struct): Ditto. (__check_null_invalid_struct_errno): Ditto. (__check_invalid_read_ptr_errno): Remove superfluous cast. * net.cc (get): Set appropriate errno if fd is not a socket. (cygwin_sendto): Fix parameter checking. (cygwin_recvfrom): Ditto. (cygwin_setsockopt): Ditto. (cygwin_getsockopt): Ditto. (cygwin_connect): Ditto. (cygwin_gethostbyaddr): Ditto. (cygwin_accept): Ditto. (cygwin_bind): Ditto. (cygwin_getsockname): Ditto. (cygwin_listen): Ditto. (cygwin_getpeername): Ditto. (cygwin_send): Ditto. (cygwin_shutdown): Ditto. Move sigframe to fhandler_socket. (cygwin_recvmsg): Fix parameter checking. Add tracing. (cygwin_sendmsg): Ditto. * fhandler_socket.cc (fhandler_socket::shutdown): Add sigframe. * resource.cc (setrlimit): Fix parameter checking.
This commit is contained in:
@ -154,16 +154,16 @@ check_null_str_errno (const char *name)
|
||||
}
|
||||
|
||||
int __stdcall
|
||||
__check_null_invalid_struct (const void *s, unsigned sz)
|
||||
__check_null_invalid_struct (void *s, unsigned sz)
|
||||
{
|
||||
if (s && !IsBadWritePtr ((void *) s, sz))
|
||||
if (s && !IsBadWritePtr (s, sz))
|
||||
return 0;
|
||||
|
||||
return EFAULT;
|
||||
}
|
||||
|
||||
int __stdcall
|
||||
__check_null_invalid_struct_errno (const void *s, unsigned sz)
|
||||
__check_null_invalid_struct_errno (void *s, unsigned sz)
|
||||
{
|
||||
int err;
|
||||
if ((err = __check_null_invalid_struct (s, sz)))
|
||||
@ -174,7 +174,7 @@ __check_null_invalid_struct_errno (const void *s, unsigned sz)
|
||||
int __stdcall
|
||||
__check_invalid_read_ptr_errno (const void *s, unsigned sz)
|
||||
{
|
||||
if (s && !IsBadReadPtr ((void *) s, sz))
|
||||
if (s && !IsBadReadPtr (s, sz))
|
||||
return 0;
|
||||
return set_errno (EFAULT);
|
||||
}
|
||||
|
Reference in New Issue
Block a user