This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/1967] no parameter check in aio_return() in rt/aio_return.c


------- Additional Comments From jakub at redhat dot com  2005-12-02 08:46 -------
Please stop with this.  There are hundreds of such functions in glibc,
and bad arguments are intentionally not checked in them, among other for
performance reasons.
http://www.opengroup.org/onlinepubs/009695399/functions/aio_return.html
doesn't allow the aiocbp argument to be NULL, it must be a reference to
a valid aiocb structure which NULL is not.
From
http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_03.html#tag_02_03
you can see that it is allowed to return -1 and EFAULT in errno in that case,
but it is not guaranteed.
Furthermore, even if you add a check for NULL, aio_return ((struct aiocb *)28);
would still crash and there is really no difference between NULL and (struct
aiocb *)28 as far as this function is concerned.  Both are invalid arguments,
triggering undefined behaviour.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


http://sourceware.org/bugzilla/show_bug.cgi?id=1967

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]