mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 17:39:53 +03:00
Cedar/Bridge.c: fix NULL pointer dereference in GetEthDeviceHash()
This commit is contained in:
parent
2d3469909b
commit
91c5d5feb8
@ -136,19 +136,23 @@ UINT GetEthDeviceHash()
|
|||||||
{
|
{
|
||||||
#ifdef OS_UNIX
|
#ifdef OS_UNIX
|
||||||
// UNIX
|
// UNIX
|
||||||
UINT num;
|
UINT num = 0;
|
||||||
UINT i;
|
UINT i;
|
||||||
char tmp[4096];
|
char tmp[4096];
|
||||||
UCHAR hash[SHA1_SIZE];
|
UCHAR hash[SHA1_SIZE];
|
||||||
TOKEN_LIST *t = GetEthList();
|
TOKEN_LIST *t = GetEthList();
|
||||||
|
|
||||||
num = t->NumTokens;
|
|
||||||
tmp[0] = 0;
|
tmp[0] = 0;
|
||||||
for (i = 0;i < t->NumTokens;i++)
|
|
||||||
|
if (t != NULL)
|
||||||
{
|
{
|
||||||
StrCat(tmp, sizeof(tmp), t->Token[i]);
|
num = t->NumTokens;
|
||||||
|
for (i = 0; i < t->NumTokens; i++)
|
||||||
|
{
|
||||||
|
StrCat(tmp, sizeof(tmp), t->Token[i]);
|
||||||
|
}
|
||||||
|
FreeToken(t);
|
||||||
}
|
}
|
||||||
FreeToken(t);
|
|
||||||
|
|
||||||
Sha0(hash, tmp, StrLen(tmp));
|
Sha0(hash, tmp, StrLen(tmp));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user