diff options
| author | tb <> | 2022-12-09 07:47:59 +0000 |
|---|---|---|
| committer | tb <> | 2022-12-09 07:47:59 +0000 |
| commit | a8436ca44d2e02a5199f615f17b3cd2e36c11760 (patch) | |
| tree | 1cc589a9329eb150eaaeef307e8cca3996911d60 /src | |
| parent | 60969b8743e9eed4a52c8a0d704602997ea0dd6f (diff) | |
| download | openbsd-a8436ca44d2e02a5199f615f17b3cd2e36c11760.tar.gz openbsd-a8436ca44d2e02a5199f615f17b3cd2e36c11760.tar.bz2 openbsd-a8436ca44d2e02a5199f615f17b3cd2e36c11760.zip | |
bio chain test: ensure the length of empty chains is 0
Diffstat (limited to 'src')
| -rw-r--r-- | src/regress/lib/libcrypto/bio/bio_chain.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/regress/lib/libcrypto/bio/bio_chain.c b/src/regress/lib/libcrypto/bio/bio_chain.c index 81b3b862f7..81f9b82040 100644 --- a/src/regress/lib/libcrypto/bio/bio_chain.c +++ b/src/regress/lib/libcrypto/bio/bio_chain.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: bio_chain.c,v 1.8 2022/12/09 07:46:54 tb Exp $ */ | 1 | /* $OpenBSD: bio_chain.c,v 1.9 2022/12/09 07:47:59 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> |
| 4 | * | 4 | * |
| @@ -200,8 +200,11 @@ walk_forward(BIO *start, BIO *end, size_t expected_len, size_t i, size_t j, | |||
| 200 | size_t len; | 200 | size_t len; |
| 201 | int ret = 0; | 201 | int ret = 0; |
| 202 | 202 | ||
| 203 | if (start == NULL || end == NULL) | 203 | if (start == NULL || end == NULL) { |
| 204 | if (expected_len != 0) | ||
| 205 | goto err; | ||
| 204 | goto done; | 206 | goto done; |
| 207 | } | ||
| 205 | 208 | ||
| 206 | next = start; | 209 | next = start; |
| 207 | len = 0; | 210 | len = 0; |
| @@ -240,8 +243,11 @@ walk_backward(BIO *start, BIO *end, size_t expected_len, size_t i, size_t j, | |||
| 240 | size_t len; | 243 | size_t len; |
| 241 | int ret = 0; | 244 | int ret = 0; |
| 242 | 245 | ||
| 243 | if (start == NULL || end == NULL) | 246 | if (start == NULL || end == NULL) { |
| 247 | if (expected_len != 0) | ||
| 248 | goto err; | ||
| 244 | goto done; | 249 | goto done; |
| 250 | } | ||
| 245 | 251 | ||
| 246 | prev = end; | 252 | prev = end; |
| 247 | len = 0; | 253 | len = 0; |
