This is an automated email from the ASF dual-hosted git repository.

cmcfarlen pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 6fb27c0b7384980ac077e0264285c6ee0cad31ed
Author: Pavel Vazharov <[email protected]>
AuthorDate: Tue Jun 11 01:34:26 2024 +0300

    Pass unused length parameter in HeaderField::append function (#11401)
    
    The parameter is passed to the TSMimeHdrFieldValueStringInsert instead
    of the current -1.
    The latter causes `strlen(value)` instead `length` bytes to be inserted
    
    (cherry picked from commit 2501e4bc5e74a9fbb6290a6c1c92a727ba850dff)
---
 src/tscpp/api/Headers.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tscpp/api/Headers.cc b/src/tscpp/api/Headers.cc
index 789cf4dc8b..e755e6b535 100644
--- a/src/tscpp/api/Headers.cc
+++ b/src/tscpp/api/Headers.cc
@@ -310,7 +310,7 @@ bool
 HeaderField::append(const char *value, int length)
 {
   return 
(TSMimeHdrFieldValueStringInsert(iter_.state_->mloc_container_->hdr_buf_, 
iter_.state_->mloc_container_->hdr_loc_,
-                                          
iter_.state_->mloc_container_->field_loc_, -1, value, -1) == TS_SUCCESS);
+                                          
iter_.state_->mloc_container_->field_loc_, -1, value, length) == TS_SUCCESS);
 }
 
 bool

Reply via email to