From: Vasiliy Kulikov <segoon@openwall.com>
To: musl <musl@lists.openwall.com>
Subject: musl bugs
Date: Tue, 27 Sep 2011 20:06:46 +0400 [thread overview]
Message-ID: <20110927160646.GA23877@albatros> (raw)
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
next reply other threads:[~2011-09-27 16:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-27 16:06 Vasiliy Kulikov [this message]
2011-09-27 21:00 ` Rich Felker
2011-09-28 7:54 ` Vasiliy Kulikov
2011-09-28 15:40 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110927160646.GA23877@albatros \
--to=segoon@openwall.com \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).