summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2003-11-15 00:21:24 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2003-11-15 00:21:24 +0000
commit3cf073402b601d6095dc763f563c357ed294df2c (patch)
treea2fb2cd4aae896dfe6585c92607ed75b4de04414
parentd1c345b3b463210090c4bd77714782e24c942550 (diff)
check getpass for NULL. from Jared Yanovich. ok otto@
-rw-r--r--usr.sbin/ppp/pppctl/pppctl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/ppp/pppctl/pppctl.c b/usr.sbin/ppp/pppctl/pppctl.c
index a0a16f4e89a..011028d73ac 100644
--- a/usr.sbin/ppp/pppctl/pppctl.c
+++ b/usr.sbin/ppp/pppctl/pppctl.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pppctl.c,v 1.15 2003/10/31 08:48:16 otto Exp $
+ * $Id: pppctl.c,v 1.16 2003/11/15 00:21:23 tedu Exp $
*/
#include <sys/types.h>
@@ -120,11 +120,12 @@ Receive(int fd, int display)
for (last = Buffer+len-2; last > Buffer && *last != ' '; last--)
;
if (last > Buffer+3 && !strncmp(last-3, " on", 3)) {
- /* a password is required ! */
+ /* a password is required! */
if (display & REC_PASSWD) {
/* password time */
if (!passwd)
- passwd = getpass("Password: ");
+ if ((passwd = getpass("Password: ")) == NULL)
+ err(1, "getpass");
snprintf(Buffer, sizeof Buffer, "passwd %s\n", passwd);
memset(passwd, '\0', strlen(passwd));
if (display & REC_VERBOSE)