crypto/evp/encode.c:313: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 2):unsigned64.
Showing all 3 steps of the trace


crypto/evp/encode.c:327:5: <LHS trace>
325.   				{
326.   				v=EVP_DecodeBlock(out,d,n);
327.   				n=0;
           ^
328.   				if (v < 0) { rv=0; goto end; }
329.   				ret+=(v-eof);

crypto/evp/encode.c:327:5: Assignment
325.   				{
326.   				v=EVP_DecodeBlock(out,d,n);
327.   				n=0;
           ^
328.   				if (v < 0) { rv=0; goto end; }
329.   				ret+=(v-eof);

crypto/evp/encode.c:313:8: Binary operation: ([0, +oo] - 2):unsigned64
311.   			eof = 0;
312.   			if (d[n-1] == '=') eof++;
313.   			if (d[n-2] == '=') eof++;
              ^
314.   			/* There will never be more than two '=' */
315.   			}

int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
		     const unsigned char *in, size_t inl)
	{
	int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,ln,tmp2,exp_nl;
	size_t n;
	unsigned char *d;
	n=ctx->num;
	d=ctx->enc_data;
	ln=ctx->line_num;
	exp_nl=ctx->expect_nl;
	if ((inl == 0) || ((n == 0) && (conv_ascii2bin(in[0]) == B64_EOF)))
		{ rv=0; goto end; }
	for (i=0; i<inl; i++)
		{
		if (ln >= 80) { rv= -1; goto end; }
		tmp= *(in++);
		v=conv_ascii2bin(tmp);
		if (!B64_NOT_BASE64(v))
			{
			OPENSSL_assert(n < (int)sizeof(ctx->enc_data));
			d[n++]=tmp;
			ln++;
			}
		else if (v == B64_ERROR)
			{
			rv= -1;
			goto end;
			}
		if (tmp == '=')
			{
			if (seof == -1) seof=n;
			eof++;
			}
		if (v == B64_CR)
			{
			ln = 0;
			if (exp_nl)
				continue;
			}
		if (v == B64_EOLN)
			{
			ln=0;
			if (exp_nl)
				{
				exp_nl=0;
				continue;
				}
			}
		exp_nl=0;
		if (((i+1) == inl) && (((n&3) == 0) || eof))
			{
			v=B64_EOF;
			eof = 0;
			if (d[n-1] == '=') eof++;
			if (d[n-2] == '=') eof++;
			}
		if ((v == B64_EOF && (n&3) == 0) || (n >= 64))
			{
			if ((v != B64_EOF) && (n >= 64)) exp_nl=1;
			tmp2=v;
			if (n > 0)
				{
				v=EVP_DecodeBlock(out,d,n);
				n=0;
				if (v < 0) { rv=0; goto end; }
				ret+=(v-eof);
				}
			else
				{
				eof=1;
				v=0;
				}
			if ((v < ctx->length) && eof)
				{
				rv=0;
				goto end;
				}
			else
				ctx->length=v;
			if (seof >= 0) { rv=0; goto end; }
			out+=v;
			}
		}
	rv=1;
end:
	*outl=ret;
	ctx->num=n;
	ctx->line_num=ln;
	ctx->expect_nl=exp_nl;
	return(rv);
	}
["int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,\n\t\t     const unsigned char *in, size_t inl)\n\t{\n\tint seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,ln,tmp2,exp_nl;\n\tsize_t n;\n\tunsigned char *d;\n\tn=ctx->num;\n\td=ctx->enc_data;\n\tln=ctx->line_num;\n\texp_nl=ctx->expect_nl;\n\tif ((inl == 0) || ((n == 0) && (conv_ascii2bin(in[0]) == B64_EOF)))\n\t\t{ rv=0; goto end; }\n\tfor (i=0; i<inl; i++)\n\t\t{\n\t\tif (ln >= 80) { rv= -1; goto end; }\n\t\ttmp= *(in++);\n\t\tv=conv_ascii2bin(tmp);\n\t\tif (!B64_NOT_BASE64(v))\n\t\t\t{\n\t\t\tOPENSSL_assert(n < (int)sizeof(ctx->enc_data));\n\t\t\td[n++]=tmp;\n\t\t\tln++;\n\t\t\t}\n\t\telse if (v == B64_ERROR)\n\t\t\t{\n\t\t\trv= -1;\n\t\t\tgoto end;\n\t\t\t}\n\t\tif (tmp == '=')\n\t\t\t{\n\t\t\tif (seof == -1) seof=n;\n\t\t\teof++;\n\t\t\t}\n\t\tif (v == B64_CR)\n\t\t\t{\n\t\t\tln = 0;\n\t\t\tif (exp_nl)\n\t\t\t\tcontinue;\n\t\t\t}\n\t\tif (v == B64_EOLN)\n\t\t\t{\n\t\t\tln=0;\n\t\t\tif (exp_nl)\n\t\t\t\t{\n\t\t\t\texp_nl=0;\n\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\texp_nl=0;\n\t\tif (((i+1) == inl) && (((n&3) == 0) || eof))\n\t\t\t{\n\t\t\tv=B64_EOF;\n\t\t\teof = 0;\n\t\t\tif (d[n-1] == '=') eof++;\n\t\t\tif (d[n-2] == '=') eof++;\n\t\t\t}\n\t\tif ((v == B64_EOF && (n&3) == 0) || (n >= 64))\n\t\t\t{\n\t\t\tif ((v != B64_EOF) && (n >= 64)) exp_nl=1;\n\t\t\ttmp2=v;\n\t\t\tif (n > 0)\n\t\t\t\t{\n\t\t\t\tv=EVP_DecodeBlock(out,d,n);\n\t\t\t\tn=0;\n\t\t\t\tif (v < 0) { rv=0; goto end; }\n\t\t\t\tret+=(v-eof);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\teof=1;\n\t\t\t\tv=0;\n\t\t\t\t}\n\t\t\tif ((v < ctx->length) && eof)\n\t\t\t\t{\n\t\t\t\trv=0;\n\t\t\t\tgoto end;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tctx->length=v;\n\t\t\tif (seof >= 0) { rv=0; goto end; }\n\t\t\tout+=v;\n\t\t\t}\n\t\t}\n\trv=1;\nend:\n\t*outl=ret;\n\tctx->num=n;\n\tctx->line_num=ln;\n\tctx->expect_nl=exp_nl;\n\treturn(rv);\n\t}"]