We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 697f54a commit 179df42Copy full SHA for 179df42
1 file changed
src/internal.c
@@ -10109,8 +10109,13 @@ static int BundlePacket(WOLFSSH* ssh)
10109
10110
/* Add the padding */
10111
WLOG(WS_LOG_DEBUG, "BP: paddingSz = %u", paddingSz);
10112
- if (ssh->encryptId == ID_NONE)
+ if (idx + paddingSz > ssh->outputBuffer.bufferSz) {
10113
+ ret = WS_BUFFER_E;
10114
+ WLOG(WS_LOG_DEBUG, "BP: paddingSz was too large");
10115
+ }
10116
+ else if (ssh->encryptId == ID_NONE) {
10117
WMEMSET(output + idx, 0, paddingSz);
10118
10119
else if (wc_RNG_GenerateBlock(ssh->rng, output + idx, paddingSz) < 0) {
10120
ret = WS_CRYPTO_FAILED;
10121
WLOG(WS_LOG_DEBUG, "BP: failed to add padding");
0 commit comments