mailing list of musl libc
 help / color / mirror / code / Atom feed
* musl bugs
@ 2011-09-27 16:06 Vasiliy Kulikov
  2011-09-27 21:00 ` Rich Felker
  0 siblings, 1 reply; 4+ messages in thread
From: Vasiliy Kulikov @ 2011-09-27 16:06 UTC (permalink / raw)
  To: musl

Hi Rich,

getmntent_r():
- fgets() should be checked for too small buffer.
- Looks like fgets() may fail.  Then ferror() should be used together
  with feof().

getmntent():
- Is linebuf[256] big enough?  IMO as the buffer is not supplied by a
  user, it should be dynamically allocated.  Calling getmntent() and
  getting truncated result/ERANGE is somewhat not expected.

addmntent():
- Here fseek() can be easily checked for errors => return 1 in case of
  error.

hasmntopt():
- Implementation is wrong.  The argument is not a substring, but a
  single option, possibly with "=value".  Glibc's implementation is OK
  IMO.

prctl() and other places:
- Why no va_end()?  It is __builtin_va_end() sometimes, and AFAIU it is
  not a noop.

getgrgid() and getgrnam():
- errno is not saved while calling endgrent() (close() inside).  POSIX
  says close() may return EIO if I/O error happened during close() with
  RO fd, altering errno.

execvp():
- As the code chooses the first possible path in $PATH, the
  /usr/local/bin should be the last path.  POSIX says it should start
  with null path (current dir), but it is crazy.
- I don't see an overflow here (comment claims so)...

-- 
Vasiliy


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-28 15:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-27 16:06 musl bugs Vasiliy Kulikov
2011-09-27 21:00 ` Rich Felker
2011-09-28  7:54   ` Vasiliy Kulikov
2011-09-28 15:40     ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).