Skip to content
  • Paul Eggert's avatar
    sigsegv: avoid unlikely undefined behavior · 459da066
    Paul Eggert authored
    Problem found by Coverity for diffutils and reported by Wasser Mai in:
    https://bugs.gnu.org/71535
    * lib/stackvma.c (rof_open) [__linux__ || __FreeBSD__ || etc]:
    Don’t assume result of ‘read’ fits in int.
    Avoid undefined behavior if ‘n + MIN_LEFTOVER’ would overflow.
    Also, move a test to be after an (n == 0) test, to help the compiler.
    459da066
To find the state of this project's repository at the time of any of these versions, check out the tags.