diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-07-21 16:18:42 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-07-21 16:18:42 +0800 |
commit | 1428a82d1644166fdaa5285c67f236ac02687818 (patch) | |
tree | 276d0104ebeaef1c5ce7ab7cf8484a685669a15d /mbbsd/register.c | |
parent | 913a0db139ff6f56e26d1199e7f5ad1c6239c5ea (diff) | |
download | pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar.gz pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar.bz2 pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar.lz pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar.xz pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.tar.zst pttbbs-1428a82d1644166fdaa5285c67f236ac02687818.zip |
strcpy() -> strlcpy()
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@428 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/register.c')
-rw-r--r-- | mbbsd/register.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mbbsd/register.c b/mbbsd/register.c index f2b50a9b..3cb92cab 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -1,4 +1,4 @@ -/* $Id: register.c,v 1.6 2002/07/05 17:10:28 in2 Exp $ */ +/* $Id: register.c,v 1.7 2002/07/21 08:18:41 in2 Exp $ */ #define _XOPEN_SOURCE #include "bbs.h" @@ -24,7 +24,7 @@ genpasswd(char *pw) c += 6; saltc[i] = c; } - strcpy(pwbuf, pw); + strlcpy(pwbuf, pw, sizeof(pwbuf)); return crypt(pwbuf, saltc); } return ""; @@ -177,7 +177,7 @@ getnewuserid() sprintf(genbuf, "uid %d", i); log_usies("APPLY", genbuf); - strcpy(zerorec.userid, str_new); + strlcpy(zerorec.userid, str_new, sizeof(zerorec.userid)); zerorec.lastlogin = clock; passwd_update(i, &zerorec); setuserid(i, zerorec.userid); |