mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-24 07:40:52 +00:00
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:
parent
eab7cc95c4
commit
07ce2a90b3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=52483
@ -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] == '/')
|
||||
|
Loading…
Reference in New Issue
Block a user