java-topology/defects/curl/unit
russell@unturf.com fbc56da95b curl/ffmpeg: CWE-407 findings — awssigv4 bubble sort + filtergraph format merge
curl-0001 (UNDF-2026-000000040): lib/http_aws_sigv4.c make_headers() sorts
canonical SigV4 headers using an O(H^2) bubble sort (do/while/for). Every
SigV4 HTTP request pays H^2 comparisons. At H=200: 35,024 vs 794 (44x).
Fix: qsort on a temporary pointer array, O(H log H).

ffmpeg-0001 (UNDF-2026-000000070): libavfilter/formats.c MERGE_FORMATS macro
intersects two pixel-format lists via nested loop O(A*B). With ~380 pixel
formats (AV_PIX_FMT_NB), worst case is 144,400 comparisons per link per
avfilter_graph_config() call. At A=B=380: 72,390 vs 3,420 (21x).
Fix: sort b, bsearch for membership, O((A+B) log B).

Unit tests: CurlTest.java, FFmpegTest.java — both PASS.
2026-03-30 09:38:07 -04:00
..
CurlCookieReplaceTest.java whitepaper: 312 sites / 151 ecosystems — wave2+3 defect tables and PDF rebuild 2026-03-27 15:23:43 -04:00
CurlHeadersAndHstsAlgorithmTest.java curl-0002/0003 + libevent-0001: header lookup O(K×H), HSTS O(N²), route dispatch O(C); libuv CLEAN; count 603→606 2026-03-27 22:46:05 -04:00
CurlMimeBuildHeaderSearchTest.java nmap-0002 + haproxy-0004 + nginx-0004 + weechat-0003 + zeek-0002 + curl-0004: 6 new CWE-407 defects in network tools; count 693→699 2026-03-29 22:22:11 -04:00
CurlTest.class curl/ffmpeg: CWE-407 findings — awssigv4 bubble sort + filtergraph format merge 2026-03-30 09:38:07 -04:00
CurlTest.java curl/ffmpeg: CWE-407 findings — awssigv4 bubble sort + filtergraph format merge 2026-03-30 09:38:07 -04:00