lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 6 Nov 2014 16:13:14 +0100 From: Petr Mladek <pmladek@...e.cz> To: Steven Rostedt <rostedt@...dmis.org> Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>, Jiri Kosina <jkosina@...e.cz>, "H. Peter Anvin" <hpa@...or.com>, Thomas Gleixner <tglx@...utronix.de> Subject: Re: [RFC][PATCH 07/12 v3] tracing: Have seq_buf use full buffer On Wed 2014-11-05 15:21:30, Steven Rostedt wrote: > On Wed, 5 Nov 2014 17:31:50 +0100 > Petr Mladek <pmladek@...e.cz> wrote: > > > > > /** > > > * seq_buf_print_seq - move the contents of seq_buf into a seq_file > > > @@ -55,7 +55,7 @@ int seq_buf_vprintf(struct seq_buf *s, const char *fmt, va_list args) > > > > > > if (s->len < s->size) { > > > len = vsnprintf(s->buffer + s->len, s->size - s->len, fmt, args); > > > - if (s->len + len < s->size) { > > > + if (s->len + len <= s->size) { > > > > This is always true because we limit vsnprintf() to write (s->size - > > s->len) bytes. Similar problem is also in the other parts of this > > patch. > > No, len is the length of bytes that should have been written, not the > amount that has been written. That is cool! I did not know that there was also this variant of the printf() functions. I am still learning. Best Regards, Petr -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists