mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-14 05:08:23 +00:00
More stack->heap
This commit is contained in:
@ -2455,11 +2455,16 @@ public:
|
|||||||
// little effect on others.
|
// little effect on others.
|
||||||
f = fopen(p,"rb");
|
f = fopen(p,"rb");
|
||||||
if (f) {
|
if (f) {
|
||||||
char buf[65535];
|
char *const buf = (char *)malloc(len*4);
|
||||||
long l = (long)fread(buf,1,sizeof(buf),f);
|
if (buf) {
|
||||||
fclose(f);
|
long l = (long)fread(buf,1,(size_t)(len*4),f);
|
||||||
if ((l == (long)len)&&(memcmp(data,buf,l) == 0))
|
fclose(f);
|
||||||
return;
|
if ((l == (long)len)&&(memcmp(data,buf,l) == 0)) {
|
||||||
|
free(buf);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
free(buf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
f = fopen(p,"wb");
|
f = fopen(p,"wb");
|
||||||
|
Reference in New Issue
Block a user