1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-04-24 21:47:24 +03:00
H.J. Lu f981bf6b9d parse_fdinfo: Don't advance pointer twice [BZ #31798]
pidfd_getpid.c has

      /* Ignore invalid large values.  */
      if (INT_MULTIPLY_WRAPV (10, n, &n)
          || INT_ADD_WRAPV (n, *l++ - '0', &n))
        return -1;

For GCC older than GCC 7, INT_ADD_WRAPV(a, b, r) is defined as

   _GL_INT_OP_WRAPV (a, b, r, +, _GL_INT_ADD_RANGE_OVERFLOW)

and *l++ - '0' is evaluated twice.  Fix BZ #31798 by moving "l++" out of
the if statement.  Tested with GCC 6.4 and GCC 14.1.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2024-05-27 06:52:45 -07:00
..
2024-05-20 13:41:39 +00:00
2024-05-20 13:41:39 +00:00
2024-05-20 13:41:39 +00:00
2024-05-20 13:41:39 +00:00
2024-05-20 13:41:39 +00:00
2024-05-20 13:41:39 +00:00
2024-05-20 13:41:39 +00:00
2024-05-20 13:41:39 +00:00
2024-01-08 17:09:36 -03:00
2024-01-08 17:09:36 -03:00
2023-07-17 10:08:10 -04:00
2023-07-17 10:08:10 -04:00
2024-01-08 17:09:36 -03:00
2024-01-08 17:09:36 -03:00
2024-01-08 17:09:36 -03:00
2024-01-08 17:09:36 -03:00
2024-01-08 17:09:36 -03:00
2024-01-08 17:09:36 -03:00
2024-01-08 17:09:36 -03:00
2024-01-08 17:09:36 -03:00
2024-01-08 17:09:36 -03:00
2024-01-08 17:09:36 -03:00
2024-01-08 17:09:36 -03:00
2024-01-08 17:09:36 -03:00
2024-01-08 17:09:36 -03:00
2023-09-05 13:08:59 -03:00
2024-01-08 17:09:36 -03:00