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>
This commit is contained in:
sheldonh 1999-10-25 09:46:57 +00:00
parent a150a46af7
commit 0a11b67bf0

View File

@ -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] == '/')