crypto/pem/pem_lib.c:407: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64 by call to `EVP_EncryptUpdate`.
Showing all 5 steps of the trace


crypto/pem/pem_lib.c:330:1: Parameter `enc->block_size`
328.   #endif
329.   
330. > int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp,
331.   		       void *x, const EVP_CIPHER *enc, unsigned char *kstr,
332.   		       int klen, pem_password_cb *callback, void *u)

crypto/pem/pem_lib.c:407:3: Call
405.   		EVP_CIPHER_CTX_init(&ctx);
406.   		EVP_EncryptInit_ex(&ctx,enc,NULL,key,iv);
407.   		EVP_EncryptUpdate(&ctx,data,&j,data,i);
         ^
408.   		EVP_EncryptFinal_ex(&ctx,&(data[j]),&i);
409.   		EVP_CIPHER_CTX_cleanup(&ctx);

crypto/evp/evp_enc.c:278:1: <LHS trace>
276.   	}
277.   
278. > int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
279.   		      const unsigned char *in, size_t inl)
280.   	{

crypto/evp/evp_enc.c:278:1: Parameter `inl`
  276.   	}
  277.   
  278. > int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
  279.   		      const unsigned char *in, size_t inl)
  280.   	{

crypto/evp/evp_enc.c:329:2: Binary operation: ([0, +oo] - 1):unsigned64 by call to `EVP_EncryptUpdate` 
  327.   	else
  328.   		*outl = 0;
  329.   	i=inl&(bl-1);
          ^
  330.   	inl-=i;
  331.   	if (inl > 0)

int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
		      const unsigned char *in, size_t inl)
	{
	size_t i;
	size_t bl;
	size_t j;
	if (inl <= 0)
		{
		*outl = 0;
		return inl == 0;
		}
	if(ctx->buf_len == 0 && (inl&(ctx->block_mask)) == 0)
		{
		if(ctx->cipher->do_cipher(ctx,out,in,inl))
			{
			*outl=inl;
			return 1;
			}
		else
			{
			*outl=0;
			return 0;
			}
		}
	i=ctx->buf_len;
	bl=ctx->cipher->block_size;
	OPENSSL_assert(bl <= (int)sizeof(ctx->buf));
	if (i != 0)
		{
		if (i+inl < bl)
			{
			memcpy(&(ctx->buf[i]),in,inl);
			ctx->buf_len+=inl;
			*outl=0;
			return 1;
			}
		else
			{
			j=bl-i;
			memcpy(&(ctx->buf[i]),in,j);
			if(!ctx->cipher->do_cipher(ctx,out,ctx->buf,bl)) return 0;
			inl-=j;
			in+=j;
			out+=bl;
			*outl=bl;
			}
		}
	else
		*outl = 0;
	i=inl&(bl-1);
	inl-=i;
	if (inl > 0)
		{
		if(!ctx->cipher->do_cipher(ctx,out,in,inl)) return 0;
		*outl+=inl;
		}
	if (i != 0)
		memcpy(ctx->buf,&(in[inl]),i);
	ctx->buf_len=i;
	return 1;
	}
["int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp,\n\t\t       void *x, const EVP_CIPHER *enc, unsigned char *kstr,\n\t\t       int klen, pem_password_cb *callback, void *u)\n\t{\n\tEVP_CIPHER_CTX ctx;\n\tint dsize=0,i,j,ret=0;\n\tunsigned char *p,*data=NULL;\n\tconst char *objstr=NULL;\n\tchar buf[PEM_BUFSIZE];\n\tunsigned char key[EVP_MAX_KEY_LENGTH];\n\tunsigned char iv[EVP_MAX_IV_LENGTH];\n\tif (enc != NULL)\n\t\t{\n\t\tobjstr=OBJ_nid2sn(EVP_CIPHER_nid(enc));\n\t\tif (objstr == NULL)\n\t\t\t{\n\t\t\tPEMerr(PEM_F_PEM_ASN1_WRITE_BIO,PEM_R_UNSUPPORTED_CIPHER);\n\t\t\tgoto err;\n\t\t\t}\n\t\t}\n\tif ((dsize=i2d(x,NULL)) < 0)\n\t\t{\n\t\tPEMerr(PEM_F_PEM_ASN1_WRITE_BIO,ERR_R_ASN1_LIB);\n\t\tdsize=0;\n\t\tgoto err;\n\t\t}\n\tdata=(unsigned char *)OPENSSL_malloc((unsigned int)dsize+20);\n\tif (data == NULL)\n\t\t{\n\t\tPEMerr(PEM_F_PEM_ASN1_WRITE_BIO,ERR_R_MALLOC_FAILURE);\n\t\tgoto err;\n\t\t}\n\tp=data;\n\ti=i2d(x,&p);\n\tif (enc != NULL)\n\t\t{\n\t\tif (kstr == NULL)\n\t\t\t{\n\t\t\tif (callback == NULL)\n\t\t\t\tklen=PEM_def_callback(buf,PEM_BUFSIZE,1,u);\n\t\t\telse\n\t\t\t\tklen=(*callback)(buf,PEM_BUFSIZE,1,u);\n\t\t\tif (klen <= 0)\n\t\t\t\t{\n\t\t\t\tPEMerr(PEM_F_PEM_ASN1_WRITE_BIO,PEM_R_READ_KEY);\n\t\t\t\tgoto err;\n\t\t\t\t}\n#ifdef CHARSET_EBCDIC\n\t\t\tebcdic2ascii(buf, buf, klen);\n#endif\n\t\t\tkstr=(unsigned char *)buf;\n\t\t\t}\n\t\tRAND_add(data,i,0);\n\t\tOPENSSL_assert(enc->iv_len <= (int)sizeof(iv));\n\t\tif (RAND_pseudo_bytes(iv,enc->iv_len) < 0)\n\t\t\tgoto err;\n\t\tEVP_BytesToKey(enc,EVP_md5(),iv,kstr,klen,1,key,NULL);\n\t\tif (kstr == (unsigned char *)buf) OPENSSL_cleanse(buf,PEM_BUFSIZE);\n\t\tOPENSSL_assert(strlen(objstr)+23+2*enc->iv_len+13 <= sizeof buf);\n\t\tbuf[0]='\\0';\n\t\tPEM_proc_type(buf,PEM_TYPE_ENCRYPTED);\n\t\tPEM_dek_info(buf,objstr,enc->iv_len,(char *)iv);\n\t\tEVP_CIPHER_CTX_init(&ctx);\n\t\tEVP_EncryptInit_ex(&ctx,enc,NULL,key,iv);\n\t\tEVP_EncryptUpdate(&ctx,data,&j,data,i);\n\t\tEVP_EncryptFinal_ex(&ctx,&(data[j]),&i);\n\t\tEVP_CIPHER_CTX_cleanup(&ctx);\n\t\ti+=j;\n\t\tret=1;\n\t\t}\n\telse\n\t\t{\n\t\tret=1;\n\t\tbuf[0]='\\0';\n\t\t}\n\ti=PEM_write_bio(bp,name,buf,data,i);\n\tif (i <= 0) ret=0;\nerr:\n\tOPENSSL_cleanse(key,sizeof(key));\n\tOPENSSL_cleanse(iv,sizeof(iv));\n\tOPENSSL_cleanse((char *)&ctx,sizeof(ctx));\n\tOPENSSL_cleanse(buf,PEM_BUFSIZE);\n\tif (data != NULL)\n\t\t{\n\t\tOPENSSL_cleanse(data,(unsigned int)dsize);\n\t\tOPENSSL_free(data);\n\t\t}\n\treturn(ret);\n\t}", 'int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,\n\t\t      const unsigned char *in, size_t inl)\n\t{\n\tsize_t i;\n\tsize_t bl;\n\tsize_t j;\n\tif (inl <= 0)\n\t\t{\n\t\t*outl = 0;\n\t\treturn inl == 0;\n\t\t}\n\tif(ctx->buf_len == 0 && (inl&(ctx->block_mask)) == 0)\n\t\t{\n\t\tif(ctx->cipher->do_cipher(ctx,out,in,inl))\n\t\t\t{\n\t\t\t*outl=inl;\n\t\t\treturn 1;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t*outl=0;\n\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\ti=ctx->buf_len;\n\tbl=ctx->cipher->block_size;\n\tOPENSSL_assert(bl <= (int)sizeof(ctx->buf));\n\tif (i != 0)\n\t\t{\n\t\tif (i+inl < bl)\n\t\t\t{\n\t\t\tmemcpy(&(ctx->buf[i]),in,inl);\n\t\t\tctx->buf_len+=inl;\n\t\t\t*outl=0;\n\t\t\treturn 1;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tj=bl-i;\n\t\t\tmemcpy(&(ctx->buf[i]),in,j);\n\t\t\tif(!ctx->cipher->do_cipher(ctx,out,ctx->buf,bl)) return 0;\n\t\t\tinl-=j;\n\t\t\tin+=j;\n\t\t\tout+=bl;\n\t\t\t*outl=bl;\n\t\t\t}\n\t\t}\n\telse\n\t\t*outl = 0;\n\ti=inl&(bl-1);\n\tinl-=i;\n\tif (inl > 0)\n\t\t{\n\t\tif(!ctx->cipher->do_cipher(ctx,out,in,inl)) return 0;\n\t\t*outl+=inl;\n\t\t}\n\tif (i != 0)\n\t\tmemcpy(ctx->buf,&(in[inl]),i);\n\tctx->buf_len=i;\n\treturn 1;\n\t}']