blob: 7203d02c78d98b33209bc4228f3f9f08da6c3775 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
signed-off-by: Ryan Sleevi <ryan.sleevi@gmail.com>
Upstream-Status: Backport
reference:https://hg.mozilla.org/projects/nss/rev/e79a09364b5e
--- a/nss/lib/ssl/ssl3con.c
+++ b/nss/lib/ssl/ssl3con.c
@@ -781,6 +781,11 @@ static SECStatus
Null_Cipher(void *ctx, unsigned char *output, int *outputLen, int maxOutputLen,
const unsigned char *input, int inputLen)
{
+ if (inputLen > maxOutputLen) {
+ *outputLen = 0; /* Match PK11_CipherOp in setting outputLen */
+ PORT_SetError(SEC_ERROR_OUTPUT_LEN);
+ return SECFailure;
+ }
*outputLen = inputLen;
if (input != output)
PORT_Memcpy(output, input, inputLen);
|