Skip to content

Commit 75b178f

Browse files
authored
Merge pull request #7492 from JacobBarthelmeh/porting
remove assumption of struct layout
2 parents b61a6ba + 5aa39a6 commit 75b178f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/internal.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11273,7 +11273,13 @@ static int GetRecordHeader(WOLFSSL* ssl, word32* inOutIdx,
1127311273
ssl->fuzzerCb(ssl, ssl->buffers.inputBuffer.buffer + *inOutIdx,
1127411274
RECORD_HEADER_SZ, FUZZ_HEAD, ssl->fuzzerCtx);
1127511275
#endif
11276-
XMEMCPY(rh, ssl->buffers.inputBuffer.buffer + *inOutIdx, RECORD_HEADER_SZ);
11276+
/* Set explicitly rather than make assumptions on struct layout */
11277+
rh->type = ssl->buffers.inputBuffer.buffer[*inOutIdx];
11278+
rh->pvMajor = ssl->buffers.inputBuffer.buffer[*inOutIdx + 1];
11279+
rh->pvMinor = ssl->buffers.inputBuffer.buffer[*inOutIdx + 2];
11280+
rh->length[0] = ssl->buffers.inputBuffer.buffer[*inOutIdx + 3];
11281+
rh->length[1] = ssl->buffers.inputBuffer.buffer[*inOutIdx + 4];
11282+
1127711283
*inOutIdx += RECORD_HEADER_SZ;
1127811284
ato16(rh->length, size);
1127911285
}

0 commit comments

Comments
 (0)