提交 9e421962 编写于 作者: A Andy Polyakov 提交者: Matt Caswell

evp/bio_enc.c: stop using pointer arithmetic for error detection.

Thanks to David Benjamin for reporting this.
Reviewed-by: NRich Salz <rsalz@openssl.org>
Reviewed-by: NRichard Levitte <levitte@openssl.org>
上级 44cb4f5b
......@@ -148,9 +148,12 @@ static int enc_read(BIO *b, char *out, int outl)
if (ctx->read_start == ctx->read_end) { /* time to read more data */
ctx->read_end = ctx->read_start = &(ctx->buf[BUF_OFFSET]);
ctx->read_end += BIO_read(next, ctx->read_start, ENC_BLOCK_SIZE);
i = BIO_read(next, ctx->read_start, ENC_BLOCK_SIZE);
if (i > 0)
ctx->read_end += i;
} else {
i = ctx->read_end - ctx->read_start;
}
i = ctx->read_end - ctx->read_start;
if (i <= 0) {
/* Should be continue next time we are called? */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册