Skip to content

Commit

Permalink
Fix bug when we take bytes from an appendable data buffer.
Browse files Browse the repository at this point in the history
We took over o.free_ but this makes the current buffer appendable, which is wrong.
  • Loading branch information
balazsracz committed Aug 4, 2024
1 parent 18c88d0 commit bc8997d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils/DataBuffer.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

#include "utils/Buffer.hxx"
#include "utils/LinkedObject.hxx"
#include "utils/macros.h"


#ifdef GTEST
//#define DEBUG_DATA_BUFFER_FREE
Expand Down Expand Up @@ -587,7 +589,11 @@ public:
o.head_->unref();
}
tail_ = o.tail_;
free_ = o.free_;
if (o.free_ < 0) {
free_ = o.free_;
} else {
free_ = -tail_->size();
}
size_ += o.size_;
return true;
}
Expand Down

0 comments on commit bc8997d

Please sign in to comment.