Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -11160,8 +11160,7 @@ static WC_INLINE int GrowAnOutputBuffer(WOLFSSL* ssl,
return MEMORY_E;

#if WOLFSSL_GENERAL_ALIGNMENT > 0
if (align)
tmp += align - hdrSz;
tmp += align - hdrSz;
#endif

#ifdef WOLFSSL_STATIC_MEMORY
Expand All @@ -11181,11 +11180,10 @@ static WC_INLINE int GrowAnOutputBuffer(WOLFSSL* ssl,
}

#if WOLFSSL_GENERAL_ALIGNMENT > 0
if (align)
outputBuffer->offset = align - hdrSz;
else
outputBuffer->offset = align - hdrSz;
#else
outputBuffer->offset = 0;
#endif
outputBuffer->offset = 0;

outputBuffer->buffer = tmp;
outputBuffer->dynamicFlag = 1;
Expand Down Expand Up @@ -11241,8 +11239,7 @@ static WC_INLINE int GrowOutputBuffer(WOLFSSL* ssl, int size)
return MEMORY_E;

#if WOLFSSL_GENERAL_ALIGNMENT > 0
if (align)
tmp += align - hdrSz;
tmp += align - hdrSz;
#endif

#ifdef WOLFSSL_STATIC_MEMORY
Expand All @@ -11267,11 +11264,10 @@ static WC_INLINE int GrowOutputBuffer(WOLFSSL* ssl, int size)
ssl->buffers.outputBuffer.dynamicFlag = 1;

#if WOLFSSL_GENERAL_ALIGNMENT > 0
if (align)
ssl->buffers.outputBuffer.offset = align - hdrSz;
else
ssl->buffers.outputBuffer.offset = align - hdrSz;
#else
ssl->buffers.outputBuffer.offset = 0;
#endif
ssl->buffers.outputBuffer.offset = 0;

ssl->buffers.outputBuffer.buffer = tmp;
ssl->buffers.outputBuffer.bufferSize = newSz;
Expand Down