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

kichan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 9ebe5a207b Update XPACK.cc to fix use-of-uninitialized-pointer-field 
case (#11287)
9ebe5a207b is described below

commit 9ebe5a207b9eeac0ca62b46ebe1e3acb258a4bf8
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
---
 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