summaryrefslogtreecommitdiffstats
path: root/crypto/bio
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2021-06-12 13:41:19 +0200
committerDr. David von Oheimb <dev@ddvo.net>2021-06-15 14:23:29 +0200
commit3b66592490e7b43b94298f53d4e58a611644fe4e (patch)
treedda015d5a4ce8bba1ddb6189795e491c005968dd /crypto/bio
parentf42b3b70d8f2b399e6a0f217bd022f38884343eb (diff)
BIO_dum_indent_cb(): Fix handling of cb return value
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15722)
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/b_dump.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/bio/b_dump.c b/crypto/bio/b_dump.c
index b99ebc0486..104813959c 100644
--- a/crypto/bio/b_dump.c
+++ b/crypto/bio/b_dump.c
@@ -29,7 +29,7 @@ int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
void *u, const void *v, int len, int indent)
{
const unsigned char *s = v;
- int ret = 0;
+ int res, ret = 0;
char buf[288 + 1];
int i, j, rows, n;
unsigned char ch;
@@ -86,7 +86,10 @@ int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
* if this is the last call then update the ddt_dump thing so that we
* will move the selection point in the debug window
*/
- ret += cb((void *)buf, n, u);
+ res = cb((void *)buf, n, u);
+ if (res < 0)
+ return res;
+ ret += res;
}
return ret;
}