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 d274136c3409c8b0c83ae66db6d0befc2a9f1d6d
Author: Kit Chan <[email protected]>
AuthorDate: Tue Apr 30 08:28:12 2024 -0700

    Update XPACK.cc to fix use-of-uninitialized-pointer-field case (#11287)
    
    * Update XPACK.cc
    
    * Update XPACK.cc
    
    * Update XPACK.cc
    
    * Update XPACK.cc
    
    * Update XPACK.cc
    
    * Update XPACK.cc
    
    * Update XPACK.cc
    
    (cherry picked from commit 9ebe5a207b9eeac0ca62b46ebe1e3acb258a4bf8)
---
 src/proxy/hdrs/XPACK.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/proxy/hdrs/XPACK.cc b/src/proxy/hdrs/XPACK.cc
index 88d731268a..7ed7bb359d 100644
--- a/src/proxy/hdrs/XPACK.cc
+++ b/src/proxy/hdrs/XPACK.cc
@@ -473,6 +473,10 @@ XpackDynamicTable::count() const
 bool
 XpackDynamicTable::_make_space(uint64_t required_size)
 {
+  if (is_empty()) {
+    // if the table is empty, skip and just check if there is enough space
+    return required_size <= this->_available;
+  }
   uint32_t freed = 0;
   uint32_t tail  = this->_calc_index(this->_entries_tail, 1);
 

Reply via email to