]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
mod_curltest: fix allocation size
authorViktor Szakats <commit@vsz.me>
Wed, 18 Mar 2026 23:53:00 +0000 (00:53 +0100)
committerViktor Szakats <commit@vsz.me>
Thu, 19 Mar 2026 11:02:10 +0000 (12:02 +0100)
It wasn't causing an issue with current usage.

Found by Codex Security

Follow-up to 35cfb081d24ae4c1608601f71890e43907643ae5 #16541

Closes #20994

tests/http/testenv/mod_curltest/mod_curltest.c

index c27596a37ef9fd2fcd4db127d7ea2bbea1314ee2..bc1c75e5d9819ddbd20f346971622e9fb3b2aa19 100644 (file)
@@ -420,7 +420,7 @@ static int curltest_tweak_handler(request_rec *r)
   if(x_hd_len > 0) {
     int i, hd_len = (16 * 1024);
     int n = (x_hd_len / hd_len);
-    char *hd_val = apr_palloc(r->pool, x_hd_len);
+    char *hd_val = apr_palloc(r->pool, hd_len);
     memset(hd_val, 'X', hd_len);
     hd_val[hd_len - 1] = 0;
     for(i = 0; i < n; ++i) {