diff options
Diffstat (limited to 'apps/storeutl.c')
-rw-r--r-- | apps/storeutl.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/storeutl.c b/apps/storeutl.c index 62f0e6135640..f8ebde44481c 100644 --- a/apps/storeutl.c +++ b/apps/storeutl.c @@ -331,14 +331,22 @@ int storeutl_main(int argc, char *argv[]) static int indent_printf(int indent, BIO *bio, const char *format, ...) { va_list args; - int ret; + int ret, vret; + + ret = BIO_printf(bio, "%*s", indent, ""); + if (ret < 0) + return ret; va_start(args, format); + vret = BIO_vprintf(bio, format, args); + va_end(args); - ret = BIO_printf(bio, "%*s", indent, "") + BIO_vprintf(bio, format, args); + if (vret < 0) + return vret; + if (vret > INT_MAX - ret) + return INT_MAX; - va_end(args); - return ret; + return ret + vret; } static int process(const char *uri, const UI_METHOD *uimeth, PW_CB_DATA *uidata, |