1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-10 05:03:06 +03:00
Files
glibc/stdio-common
Adhemerval Zanella e59bdf63cb stdio-common: Suppress Clang warnings on scanf13.c with fortify enable
clang-19 shows:

scanf13.c:28:40: error: 'sscanf' may overflow; destination buffer in argument 4 has size 8, but the corresponding specifier may require size 11 [-Werror,-Wfortify-source]
   28 |               "A%ms%10ms%4m[bcd]%4mcB", &sp1, &sp2, &sp3, &sp4) != 4)
      |                                               ^
scanf13.c:94:34: error: 'sscanf' may overflow; destination buffer in argument 3 has size 8, but the corresponding specifier may require size 2049 [-Werror,-Wfortify-source]
   94 |   if (sscanf (buf, "%2048ms%mc", &sp3, &sp4) != 2)
      |                                  ^
scanf13.c:110:61: error: 'sscanf' may overflow; destination buffer in argument 4 has size 8, but the corresponding specifier may require size 1501 [-Werror,-Wfortify-source]
  110 |   if (sscanf (buf, "%4mc%1500m[dr/]%548m[abc/d]%3mc", &sp1, &sp2, &sp3, &sp4)
      |                                                             ^
scanf13.c:110:67: error: 'sscanf' may overflow; destination buffer in argument 5 has size 8, but the corresponding specifier may require size 549 [-Werror,-Wfortify-source]
  110 |   if (sscanf (buf, "%4mc%1500m[dr/]%548m[abc/d]%3mc", &sp1, &sp2, &sp3, &sp4)

clang does have some support to handle 'm' prefix for -Wformat; but it
lacks support for -Wfortify to understand that it is up to libc to
allocate the memory, and uses the pointer size instead to calculate
validity.
2025-01-13 10:53:08 -03:00
..
2024-12-22 17:29:28 +08:00
2023-06-13 19:59:08 -04:00
2023-06-13 19:59:08 -04:00
2024-12-22 17:29:28 +08:00
2023-06-01 13:01:32 -04:00
2023-06-13 19:59:08 -04:00
2021-09-03 22:06:44 +05:30
2023-06-01 13:01:32 -04:00
2023-05-18 12:34:00 -04:00
2023-05-18 12:34:00 -04:00
2023-05-18 12:34:00 -04:00
2023-06-13 19:59:08 -04:00
2017-11-16 11:49:26 +05:30
2017-11-16 11:49:26 +05:30
2023-10-30 13:03:59 -03:00