mirror of
https://github.com/tihmstar/futurerestore.git
synced 2025-07-09 16:10:32 +00:00
added more fread checks (this could have fucked up stuff :O)
This commit is contained in:
parent
63f0d95f2a
commit
9e61f9bf3f
|
@ -213,7 +213,7 @@ void futurerestore::waitForNonce(vector<const char *>nonces, size_t nonceSize){
|
||||||
}
|
}
|
||||||
void futurerestore::waitForNonce(){
|
void futurerestore::waitForNonce(){
|
||||||
if (!_im4ms.size()) reterror(-1, "No IM4M loaded\n");
|
if (!_im4ms.size()) reterror(-1, "No IM4M loaded\n");
|
||||||
size_t nonceSize;
|
size_t nonceSize = 0;
|
||||||
vector<const char*>nonces;
|
vector<const char*>nonces;
|
||||||
|
|
||||||
for (auto im4m : _im4ms){
|
for (auto im4m : _im4ms){
|
||||||
|
@ -235,7 +235,12 @@ void futurerestore::loadAPTickets(const vector<const char *> &apticketPaths){
|
||||||
fseek(f, 0, SEEK_SET);
|
fseek(f, 0, SEEK_SET);
|
||||||
char *buf = (char*)malloc(fSize+1);
|
char *buf = (char*)malloc(fSize+1);
|
||||||
memset(buf, 0, fSize+1);
|
memset(buf, 0, fSize+1);
|
||||||
fread(buf, fSize, 1, f);
|
|
||||||
|
size_t freadRet = 0;
|
||||||
|
if ((freadRet = fread(buf, 1, fSize, f)) != fSize){
|
||||||
|
reterror(-15,"fread=%zu but fSize=%zu",freadRet,fSize);
|
||||||
|
}
|
||||||
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
plist_t apticket = NULL;
|
plist_t apticket = NULL;
|
||||||
|
@ -802,7 +807,11 @@ plist_t futurerestore::loadPlistFromFile(const char *path){
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
fread(buf, 1, bufSize, f);
|
size_t freadRet = 0;
|
||||||
|
if ((freadRet = fread(buf, 1, bufSize, f)) != bufSize){
|
||||||
|
error("fread=%zu but bufsize=%zu",freadRet,bufSize);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
if (memcmp(buf, "bplist00", 8) == 0)
|
if (memcmp(buf, "bplist00", 8) == 0)
|
||||||
|
|
Loading…
Reference in a new issue