[prev in list] [next in list] [prev in thread] [next in thread]
List: openssl-cvs
Subject: cvs commit: openssl/apps passwd.c
From: bodo () openssl ! org
Date: 2000-04-27 6:47:24
[Download RAW message or body]
bodo 27-Apr-2000 08:47:24
Modified: apps passwd.c
Log:
Warn about truncation also in the case when a single password is read using
the password prompt.
Revision Changes Path
1.9 +4 -2 openssl/apps/passwd.c
Index: passwd.c
===================================================================
RCS file: /e/openssl/cvs/openssl/apps/passwd.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- passwd.c 2000/02/24 10:37:58 1.8
+++ passwd.c 2000/04/27 06:47:23 1.9
@@ -196,7 +196,9 @@
if (passwds == NULL)
{
/* no passwords on the command line */
- passwd = passwd_malloc = Malloc(pw_maxlen + 1);
+#define PASSWD_MALLOC_SIZE (pw_maxlen + 2)
+ /* longer than necessary so that we can warn about truncation */
+ passwd = passwd_malloc = Malloc(PASSWD_MALLOC_SIZE);
if (passwd_malloc == NULL)
goto err;
}
@@ -208,7 +210,7 @@
passwds = passwds_static;
if (in == NULL)
- if (EVP_read_pw_string(passwd_malloc, pw_maxlen + 1, "Password: ", 0) != 0)
+ if (EVP_read_pw_string(passwd_malloc, PASSWD_MALLOC_SIZE, "Password: ", 0) != 0)
goto err;
passwds[0] = passwd_malloc;
}
______________________________________________________________________
OpenSSL Project http://www.openssl.org
CVS Repository Commit List openssl-cvs@openssl.org
Automated List Manager majordomo@openssl.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic