From 619dec51f630116843a7d83c0c085abc7e3da688 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 25 Feb 2008 19:00:43 +0000 Subject: fixed resize issue with buffer->xPacket --- encryptedPacket.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'encryptedPacket.cpp') diff --git a/encryptedPacket.cpp b/encryptedPacket.cpp index a3e5886..b618f99 100644 --- a/encryptedPacket.cpp +++ b/encryptedPacket.cpp @@ -113,8 +113,13 @@ u_int32_t EncryptedPacket::getPayloadLength() const void EncryptedPacket::setPayloadLength(u_int32_t payload_length) { Buffer::setLength(payload_length + sizeof(struct HeaderStruct)); - - // depending on allow_realloc buf_ may point to another address + // depending on allow_realloc buf_ may point to another address + // therefore in this case reinit() gets called by Buffer::setLength() +} + +void EncryptedPacket::reinit() +{ + Buffer::reinit(); header_ = reinterpret_cast(buf_); payload_ = buf_ + sizeof(struct HeaderStruct); // TODO: fix auth_tag stuff auth_tag_ = NULL; // TODO: fix auth_tag stuff -- cgit v1.2.3