mirror of
https://github.com/opnsense/src.git
synced 2026-02-03 20:49:35 -05:00
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) |
||
|---|---|---|
| .. | ||
| tests | ||
| diff.1 | ||
| diff.c | ||
| diff.h | ||
| diffdir.c | ||
| diffreg.c | ||
| Makefile | ||
| pr.c | ||
| pr.h | ||
| TODO | ||
| xmalloc.c | ||
| xmalloc.h | ||