Skip to content

Commit b626507

Browse files
committed
Guard outLen assignment on error
1 parent 5326572 commit b626507

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/wp_aes_stream.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,9 @@ static int wp_aes_stream_cipher(wp_AesStreamCtx* ctx, unsigned char* out,
694694
ok = 0;
695695
}
696696

697-
*outLen = inLen;
697+
if (ok) {
698+
*outLen = inLen;
699+
}
698700
WOLFPROV_LEAVE(WP_LOG_COMP_AES, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), ok);
699701
return ok;
700702
}

0 commit comments

Comments
 (0)