mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
dummynet: do not overflow the points[ED_MAX_SAMPLES_NO] array
Otherwise, the following would segfault dnctl pipe 1 config bw 1Mbit/s profile 1025points.txt Found with: Claude Code Sonnet 5 MFC after: 2 weeks
This commit is contained in:
1 parent
30c20ca26e
commit
04fcf30961
1 file changed
+3
@@ -959,6 +959,9 @@ load_extra_delays(const char *filename, struct dn_profile *p,
|
||||
} else if (do_points) {
|
||||
if (!is_valid_number(name) || !is_valid_number(arg))
|
||||
errx(ED_EFMT("invalid point found"));
|
||||
if (points_no >= ED_MAX_SAMPLES_NO)
|
||||
errx(ED_EFMT("too many samples, maximum is %d"),
|
||||
ED_MAX_SAMPLES_NO);
|
||||
if (delay_first) {
|
||||
points[points_no].delay = atof(name);
|
||||
points[points_no].prob = atof(arg);
|
||||
|
||||
Reference in new issue
Block a user