[PATCH] lib: -Wformat-truncation in rsa_engine_get_priv_key

Tom Rini trini at konsulko.com
Thu Sep 2 15:28:53 CEST 2021


On Fri, Jul 30, 2021 at 05:05:07PM +0200, Heinrich Schuchardt wrote:

> With glibc 2.33 (Ubuntu package glibc6 2.33-0ubuntu9) building
> sifive_unmatched_defconfig results in:
> 
> In file included from /usr/include/stdio.h:866,
>                   from ././include/compiler.h:26,
>                   from <command-line>:
> In function ‘snprintf’,
>      inlined from ‘rsa_engine_get_priv_key’ at ./tools/../^:273:4:
> /usr/include/riscv64-linux-gnu/bits/stdio2.h:71:10: warning:
> ‘%s’ directive argument is null [-Wformat-truncation=]
>     71 |   return __builtin___snprintf_chk (__s, __n, 
> __USE_FORTIFY_LEVEL - 1,
>        | 
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     72 |        __glibc_objsize (__s), __fmt,
>        |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     73 |        __va_arg_pack ());
>        |        ~~~~~~~~~~~~~~~~~
> 
> Avoid passing a NULL string.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>

Applied to u-boot/next, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210902/069892a4/attachment.sig>


More information about the U-Boot mailing list