[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Thu Mar 31 10:37:37 UTC 2016


The branch master has been updated
       via  4de9913b8c2a11f17258a2ad5e357046fd221360 (commit)
      from  b3895f42a9a90a74097c75e39d87ed3212be18dd (commit)


- Log -----------------------------------------------------------------
commit 4de9913b8c2a11f17258a2ad5e357046fd221360
Author: Richard Levitte <levitte at openssl.org>
Date:   Thu Mar 31 08:29:39 2016 +0200

    Make the '-in' option in apps/passwd.c less mandatory
    
    Reviewed-by: Matt Caswell <matt at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 apps/passwd.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/apps/passwd.c b/apps/passwd.c
index f0ab243..7ae9e88 100644
--- a/apps/passwd.c
+++ b/apps/passwd.c
@@ -201,14 +201,20 @@ int passwd_main(int argc, char **argv)
         goto opthelp;
 # endif
 
-    if (infile && in_stdin) {
+    if (infile != NULL && in_stdin) {
         BIO_printf(bio_err, "%s: Can't combine -in and -stdin\n", prog);
         goto end;
     }
 
-    in = bio_open_default(infile, 'r', FORMAT_TEXT);
-    if (in == NULL)
-        goto end;
+    if (infile != NULL || in_stdin) {
+        /*
+         * If in_stdin is true, we know that infile is NULL, and that
+         * bio_open_default() will give us back an alias for stdin.
+         */
+        in = bio_open_default(infile, 'r', FORMAT_TEXT);
+        if (in == NULL)
+            goto end;
+    }
 
     if (usecrypt)
         pw_maxlen = 8;


More information about the openssl-commits mailing list