Skip to content

Commit 8741805

Browse files
authored
Merge pull request #9476 from embhorn/zd20515
Fix Coverity dead code report
2 parents a2f46cd + 6de31e9 commit 8741805

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

src/internal.c

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11165,8 +11165,7 @@ static WC_INLINE int GrowAnOutputBuffer(WOLFSSL* ssl,
1116511165
return MEMORY_E;
1116611166

1116711167
#if WOLFSSL_GENERAL_ALIGNMENT > 0
11168-
if (align)
11169-
tmp += align - hdrSz;
11168+
tmp += align - hdrSz;
1117011169
#endif
1117111170

1117211171
#ifdef WOLFSSL_STATIC_MEMORY
@@ -11186,11 +11185,10 @@ static WC_INLINE int GrowAnOutputBuffer(WOLFSSL* ssl,
1118611185
}
1118711186

1118811187
#if WOLFSSL_GENERAL_ALIGNMENT > 0
11189-
if (align)
11190-
outputBuffer->offset = align - hdrSz;
11191-
else
11188+
outputBuffer->offset = align - hdrSz;
11189+
#else
11190+
outputBuffer->offset = 0;
1119211191
#endif
11193-
outputBuffer->offset = 0;
1119411192

1119511193
outputBuffer->buffer = tmp;
1119611194
outputBuffer->dynamicFlag = 1;
@@ -11246,8 +11244,7 @@ static WC_INLINE int GrowOutputBuffer(WOLFSSL* ssl, int size)
1124611244
return MEMORY_E;
1124711245

1124811246
#if WOLFSSL_GENERAL_ALIGNMENT > 0
11249-
if (align)
11250-
tmp += align - hdrSz;
11247+
tmp += align - hdrSz;
1125111248
#endif
1125211249

1125311250
#ifdef WOLFSSL_STATIC_MEMORY
@@ -11272,11 +11269,10 @@ static WC_INLINE int GrowOutputBuffer(WOLFSSL* ssl, int size)
1127211269
ssl->buffers.outputBuffer.dynamicFlag = 1;
1127311270

1127411271
#if WOLFSSL_GENERAL_ALIGNMENT > 0
11275-
if (align)
11276-
ssl->buffers.outputBuffer.offset = align - hdrSz;
11277-
else
11272+
ssl->buffers.outputBuffer.offset = align - hdrSz;
11273+
#else
11274+
ssl->buffers.outputBuffer.offset = 0;
1127811275
#endif
11279-
ssl->buffers.outputBuffer.offset = 0;
1128011276

1128111277
ssl->buffers.outputBuffer.buffer = tmp;
1128211278
ssl->buffers.outputBuffer.bufferSize = newSz;

0 commit comments

Comments
 (0)