diff options
author | Sheldon Hearn <sheldonh@FreeBSD.org> | 1999-10-25 09:46:57 +0000 |
---|---|---|
committer | Sheldon Hearn <sheldonh@FreeBSD.org> | 1999-10-25 09:46:57 +0000 |
commit | 07ce2a90b3322aefb67d7185f61a7d4f00036411 (patch) | |
tree | f8f4feadef68de9a1df53e245a26fcad866d5a36 /usr.sbin/vipw | |
parent | eab7cc95c414ffc6b5c0735a4f4f7f9fa54fa90f (diff) | |
download | src-07ce2a90b3322aefb67d7185f61a7d4f00036411.tar.gz src-07ce2a90b3322aefb67d7185f61a7d4f00036411.zip |
Do not rely on malloc() to zero-fill allocated memory, since it is
not documented as doing so. This fixes a potential segmentation
violation.
PR: 14465
Reported by: Tony Finch <fanf@demon.net>
Notes
Notes:
svn path=/head/; revision=52483
Diffstat (limited to 'usr.sbin/vipw')
-rw-r--r-- | usr.sbin/vipw/vipw.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/vipw/vipw.c b/usr.sbin/vipw/vipw.c index bf56eed4d631..8986ab3bc1bd 100644 --- a/usr.sbin/vipw/vipw.c +++ b/usr.sbin/vipw/vipw.c @@ -81,8 +81,9 @@ main(argc, argv) err(1, NULL); strcpy(masterpasswd, optarg); if (masterpasswd[strlen(masterpasswd) - 1] != '/') - masterpasswd[strlen(masterpasswd)] = '/'; - strcat(masterpasswd, _MASTERPASSWD); + strcat(masterpasswd, "/" _MASTERPASSWD); + else + strcat(masterpasswd, _MASTERPASSWD); if ((mppath = strdup(optarg)) == NULL) err(1, NULL); if (mppath[strlen(mppath) - 1] == '/') |