Files
poky/meta/recipes-core/glibc
Nikhil R 70349820ed glibc: Suppress GCC -Os warning on user2netname for sunrpc
When building with GCC -Os, a warning is triggered indicating that sprintf might overflow.

Error:
  netname.c: In function 'user2netname':
  netname.c:51:28: error: '%s' directive writing up to 255 bytes into a
  region of size between 239 and 249 [-Werror=format-overflow=]
     51 |   sprintf (netname, "%s.%d@%s", OPSYS, uid, dfltdom);
        |                            ^~               ~~~~~~~
  netname.c:51:3: note: 'sprintf' output between 8 and 273 bytes into a
  destination of size 256
     51 |   sprintf (netname, "%s.%d@%s", OPSYS, uid, dfltdom);
        |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors

However the code does test prior the sprintf call that dfltdom plus
the required extra space for OPSYS, uid, and extra character will not
overflow and return 0 instead.

Upstream-patch: 6128e82ebe

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
(From OE-Core rev: 78fac0f623e01bd52b2ea3a597d056726deca8a4)

Signed-off-by: Nikhil R <nikhilr5@kpit.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2025-02-15 06:04:44 -08:00
..
2021-08-02 15:44:10 +01:00
2022-02-10 10:32:07 +00:00
2022-02-10 10:32:07 +00:00
2022-02-10 10:32:07 +00:00
2022-02-10 10:32:07 +00:00