stack.c: add missing direct error reporting and improve coding style
[openssl.git] / crypto / conf / conf_def.c
index 5ada0fe056852764466d9df3ceeb9d53cedbdd0c..5370e06bf95b31bbc0f4d2cef03dea1696bd3fcc 100644 (file)
@@ -296,7 +296,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
             }
 #endif
             /* no more files in directory, continue with processing parent */
-            if ((parent = sk_BIO_pop(biosk)) == NULL) {
+            if (sk_BIO_num(biosk) < 1 || (parent = sk_BIO_pop(biosk)) == NULL) {
                 /* everything processed get out of the loop */
                 break;
             } else {