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:
Maxim Konovalov committed 2026-09-22 02:36:46 +00:00
1 parent 30c20ca26e
commit 04fcf30961
1 file changed
+3
+3
View File
@@ -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);