| ea68175b | 29-Jul-2024 |
Dag-Erling Smørgrav <[email protected]> |
diff: Fix integer overflow.
The legacy Stone algorithm uses `int` to represent line numbers, array indices, and array lengths. If given inputs approaching `INT_MAX` lines, it would overflow and att
diff: Fix integer overflow.
The legacy Stone algorithm uses `int` to represent line numbers, array indices, and array lengths. If given inputs approaching `INT_MAX` lines, it would overflow and attempt to allocate ridiculously large amounts of memory. To avoid this without penalizing non-pathological inputs, switch a few variables to `size_t` and add checks while and immediately after reading both inputs.
MFC after: 3 days PR: 280371 Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D46169
(cherry picked from commit 9317242469f1ca682626d9806f8caf65d143c09a)
show more ...
|
| 54d65fdd | 14-Dec-2022 |
Kyle Evans <[email protected]> |
diff: restyle loop a bit
This is a bit more readable, and this loop is probably unlikely to gain any `continue` or `break`s.
Suggested by: pstef Differential Revision: https://reviews.freebsd.org/D
diff: restyle loop a bit
This is a bit more readable, and this loop is probably unlikely to gain any `continue` or `break`s.
Suggested by: pstef Differential Revision: https://reviews.freebsd.org/D37676
show more ...
|
| 6100374c | 16-Nov-2022 |
John Baldwin <[email protected]> |
diff: Don't (ab)use sprintf() as a kind of strcat().
Previously print_header() used sprintf() of a buffer to itself as a kind of string builder but without checking for overflows. This raised -Wfor
diff: Don't (ab)use sprintf() as a kind of strcat().
Previously print_header() used sprintf() of a buffer to itself as a kind of string builder but without checking for overflows. This raised -Wformat-truncation and -Wrestrict warnings in GCC. Instead, just conditionally print the new timestamp fields after the initial strftime()-formatted string. While here, use sizeof(buf) with strftime() rather than a magic number.
Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D36814
show more ...
|
| 3931c072 | 18-Feb-2022 |
Tom Jones <[email protected]> |
diff: fix failed compare when ignoring file case
With --ignore-file-name-case we need to compare files regardless of case. We need to propigate both names down to diffit so we can look up the correc
diff: fix failed compare when ignoring file case
With --ignore-file-name-case we need to compare files regardless of case. We need to propigate both names down to diffit so we can look up the correct file when the names differ based on case, otherwise we try to look up the file using the case from the a tree which might not be discoverable if its case is different in the b tree.
Reviewed by: bapt Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D34201
show more ...
|