+2001-10-18 Christopher Faylor <cgf@redhat.com>
+
+ * syscalls.cc (_read): Validate input pointer.
+ (_write): Ditto.
+ (system): Ditto.
+
2001-10-16 Frederic Devernay <Frederic.Devernay@sophia.inria.fr>
* poll.cc (poll): Call cygwin_select() if any fd is valid.
extern "C" ssize_t
_read (int fd, void *ptr, size_t len)
{
+ if (__check_null_invalid_struct_errno (ptr, len))
+ return -1;
+
int res;
extern int sigcatchers;
int e = get_errno ();
extern "C" ssize_t
_write (int fd, const void *ptr, size_t len)
{
+ if (__check_null_invalid_struct_errno (ptr, len))
+ return -1;
+
int res = -1;
- sigframe thisframe (mainthread);
+ sigframe thisframe (mainthread);
cygheap_fdget cfd (fd);
if (cfd < 0)
goto done;
extern "C" int
system (const char *cmdstring)
{
+ if (check_null_empty_str_errno (cmdstring))
+ return -1;
+
sigframe thisframe (mainthread);
int res;
const char* command[4];