mailing list of musl libc
 help / color / mirror / code / Atom feed
* vprintf.c bug
@ 2016-07-26 22:25 Jacob Abrams
  2016-07-27  3:17 ` Rich Felker
  0 siblings, 1 reply; 4+ messages in thread
From: Jacob Abrams @ 2016-07-26 22:25 UTC (permalink / raw)
  To: musl

I believe there is a small bug in vfprintf.c

I had to change the if statement from

    ret = printf_core(f, fmt, &ap2, nl_arg, nl_type);
    if (saved_buf) {

to

    ret = printf_core(f, fmt, &ap2, nl_arg, nl_type);
    if (f->buf == internal_buf) {

Because the saved_buf may be NULL which will result the internal
buffer being used but the file not being reset properly after the call
to printf_core. This was discovered while using MUSL v1.1.4 on an OS
other than Linux.

Please cc-me on any response.

Regards,
Jacob
jacob@clover.com


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

end of thread, other threads:[~2016-08-02 20:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-26 22:25 vprintf.c bug Jacob Abrams
2016-07-27  3:17 ` Rich Felker
2016-08-02 20:02   ` Jacob Abrams
2016-08-02 20:11     ` 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).