diff options
| author | kenjiro <> | 2026-07-17 12:41:52 +0000 |
|---|---|---|
| committer | kenjiro <> | 2026-07-17 12:41:52 +0000 |
| commit | 0d4e72afe98aa7fa6f7761c9960509278e28233a (patch) | |
| tree | c244fd0af513a8381dcbfc1bac737d0760878453 /src/lib | |
| parent | a41d18bdd84d10a10ae0ae8782848b9f0d987e22 (diff) | |
| download | openbsd-0d4e72afe98aa7fa6f7761c9960509278e28233a.tar.gz openbsd-0d4e72afe98aa7fa6f7761c9960509278e28233a.tar.bz2 openbsd-0d4e72afe98aa7fa6f7761c9960509278e28233a.zip | |
Remove redundant BIO_write() length assertions in b64_write()
b64_write() asserted that BIO_write() does not return more bytes than
requested in two places. Other BIO_write() call sites do not make this
check, and there is no special handling here that depends on asserting this
condition.
ok tb@ beck@ joshua@
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/libcrypto/evp/bio_b64.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lib/libcrypto/evp/bio_b64.c b/src/lib/libcrypto/evp/bio_b64.c index 32cd1f06df..61a26df868 100644 --- a/src/lib/libcrypto/evp/bio_b64.c +++ b/src/lib/libcrypto/evp/bio_b64.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: bio_b64.c,v 1.29 2024/04/09 13:52:41 beck Exp $ */ | 1 | /* $OpenBSD: bio_b64.c,v 1.30 2026/07/17 12:41:52 kenjiro Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -380,7 +380,6 @@ b64_write(BIO *b, const char *in, int inl) | |||
| 380 | BIO_copy_next_retry(b); | 380 | BIO_copy_next_retry(b); |
| 381 | return (i); | 381 | return (i); |
| 382 | } | 382 | } |
| 383 | OPENSSL_assert(i <= n); | ||
| 384 | ctx->buf_off += i; | 383 | ctx->buf_off += i; |
| 385 | OPENSSL_assert(ctx->buf_off <= (int)sizeof(ctx->buf)); | 384 | OPENSSL_assert(ctx->buf_off <= (int)sizeof(ctx->buf)); |
| 386 | OPENSSL_assert(ctx->buf_len >= ctx->buf_off); | 385 | OPENSSL_assert(ctx->buf_len >= ctx->buf_off); |
| @@ -453,7 +452,6 @@ b64_write(BIO *b, const char *in, int inl) | |||
| 453 | BIO_copy_next_retry(b); | 452 | BIO_copy_next_retry(b); |
| 454 | return ((ret == 0) ? i : ret); | 453 | return ((ret == 0) ? i : ret); |
| 455 | } | 454 | } |
| 456 | OPENSSL_assert(i <= n); | ||
| 457 | n -= i; | 455 | n -= i; |
| 458 | ctx->buf_off += i; | 456 | ctx->buf_off += i; |
| 459 | OPENSSL_assert(ctx->buf_off <= (int)sizeof(ctx->buf)); | 457 | OPENSSL_assert(ctx->buf_off <= (int)sizeof(ctx->buf)); |
