From: deraadt Date: Wed, 4 Sep 1996 05:10:23 +0000 (+0000) Subject: _PASSWORD_LEN != 255 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9f08e12f718e685f2b130806e901b38b113d1354;p=openbsd _PASSWORD_LEN != 255 --- diff --git a/kerberosIV/register/register.c b/kerberosIV/register/register.c index 067cb2d404c..3928fefa9c2 100644 --- a/kerberosIV/register/register.c +++ b/kerberosIV/register/register.c @@ -1,4 +1,4 @@ -/* $Id: register.c,v 1.2 1996/04/17 07:23:33 tholo Exp $ */ +/* $Id: register.c,v 1.3 1996/09/04 05:10:23 deraadt Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -76,6 +76,7 @@ static char password[_PASSWORD_LEN]; void die(); void setup_key(), type_info(), cleanup(); +int main(argc, argv) int argc; char **argv; @@ -87,6 +88,7 @@ main(argc, argv) int sock, llen; u_char code; static struct rlimit rl = { 0, 0 }; + char passbuf[255]; signal(SIGPIPE, die); @@ -170,11 +172,15 @@ main(argc, argv) exit(1); } + bzero(passbuf, sizeof passbuf); + bcopy(password, passbuf, sizeof password); if (des_write(sock, password, 255) != 255) { + bzero(passbuf, sizeof passbuf); perror("write password"); cleanup(); exit(1); } + bzero(passbuf, sizeof passbuf); /* get return message */ @@ -211,7 +217,7 @@ main(argc, argv) void cleanup() { - bzero(password, 255); + bzero(password, sizeof password); } extern char *crypt();