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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 26 Oct 2015 15:43:23 +0900
From:	Kees Cook <keescook@...omium.org>
To:	Rasmus Villemoes <linux@...musvillemoes.dk>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 09/13] lib/test_printf.c: add a few string tests

On Wed, Oct 21, 2015 at 5:30 AM, Rasmus Villemoes
<linux@...musvillemoes.dk> wrote:
> Cc: Kees Cook <keescook@...omium.org>
> Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.dk>

I would expect at least a short commit message, with something like
"check string width truncation", but otherwise, I like it. :)

Acked-by: Kees Cook <keescook@...omium.org>

-Kees

> ---
>  lib/test_printf.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/lib/test_printf.c b/lib/test_printf.c
> index 1ce1a1dd8faf..80ddafb2675d 100644
> --- a/lib/test_printf.c
> +++ b/lib/test_printf.c
> @@ -166,6 +166,10 @@ test_string(void)
>         test("", "%s%.0s", "", "123");
>         test("ABCD|abc|123", "%s|%.3s|%.*s", "ABCD", "abcdef", 3, "123456");
>         test("1  |  2|3  |  4|5  ", "%-3s|%3s|%-*s|%*s|%*s", "1", "2", 3, "3", 3, "4", -3, "5");
> +       test("1234      ", "%-10.4s", "123456");
> +       test("      1234", "%10.4s", "123456");
> +       /* Negative precision should be treated as 0. */
> +       test("    ", "%4.*s", -5, "123456");
>         /*
>          * POSIX and C99 say that a missing precision should be
>          * treated as a precision of 0. However, the kernel's printf
> --
> 2.6.1
>



-- 
Kees Cook
Chrome OS Security
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ