mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 04:53:28 +00:00
MFC rev. 1.6
Fix incorrect handling of malloc failures PR: bin/83369
This commit is contained in:
parent
b8c6fb47f8
commit
e86d3565be
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/stable/7/; revision=177755
@ -67,7 +67,9 @@ xencrypt(secret, passwd)
|
||||
int len;
|
||||
|
||||
len = strlen(secret) / 2;
|
||||
buf = malloc((unsigned)len);
|
||||
if ((buf = malloc((unsigned)len)) == NULL) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
hex2bin(len, secret, buf);
|
||||
passwd2des(passwd, key);
|
||||
@ -100,7 +102,9 @@ xdecrypt(secret, passwd)
|
||||
int len;
|
||||
|
||||
len = strlen(secret) / 2;
|
||||
buf = malloc((unsigned)len);
|
||||
if ((buf = malloc((unsigned)len)) == NULL) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
hex2bin(len, secret, buf);
|
||||
passwd2des(passwd, key);
|
||||
|
Loading…
Reference in New Issue
Block a user