Commit b10c85c
fix(resp): bound aggregate parser allocations
Reject aggregate declarations above the Redis 8.8.1 INT_MAX boundary and cap initial Array, Map, Set, and Push capacity at 1024 entries so unauthenticated input cannot directly request an unbounded Vec allocation.
Add regression coverage for exact boundary overflow, i64 capacity overflow, and the maximum accepted declaration without changing existing null or incomplete-frame semantics.
Constraint: This commit changes only the RESP parser and its in-file tests; bulk payload and connection buffer limits remain separate work.
Confidence: High; the original test failed with capacity overflow and passed after the shared capacity guard was applied.
Scope-risk: Low; normal aggregate parsing is unchanged and all four allocation sites use one private helper.
Tested: Windows and WSL cargo test -p resp; Windows and WSL target Clippy; cargo fmt --all -- --check; git diff --check.
Not-tested: Full workspace and process-level network suites were not rerun because no network, storage, Cargo, or server code changed.
Co-authored-by: OmX <omx@oh-my-codex.dev>1 parent 727590e commit b10c85c
1 file changed
Lines changed: 67 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
85 | 106 | | |
86 | 107 | | |
87 | 108 | | |
| |||
212 | 233 | | |
213 | 234 | | |
214 | 235 | | |
215 | | - | |
| 236 | + | |
216 | 237 | | |
217 | 238 | | |
218 | 239 | | |
| |||
353 | 374 | | |
354 | 375 | | |
355 | 376 | | |
356 | | - | |
| 377 | + | |
357 | 378 | | |
358 | 379 | | |
359 | 380 | | |
| |||
382 | 403 | | |
383 | 404 | | |
384 | 405 | | |
385 | | - | |
| 406 | + | |
386 | 407 | | |
387 | 408 | | |
388 | 409 | | |
| |||
410 | 431 | | |
411 | 432 | | |
412 | 433 | | |
413 | | - | |
| 434 | + | |
414 | 435 | | |
415 | 436 | | |
416 | 437 | | |
| |||
908 | 929 | | |
909 | 930 | | |
910 | 931 | | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
911 | 974 | | |
912 | 975 | | |
913 | 976 | | |
| |||
0 commit comments