PhotoRec: check fseek return value in pzh file validation
This commit is contained in:
parent
21ec1345e9
commit
0053652d69
@ -62,9 +62,14 @@ static void file_rename_pzh(const char *old_filename)
|
||||
int buffer_size;
|
||||
if((file=fopen(old_filename, "rb"))==NULL)
|
||||
return;
|
||||
fseek(file, 0x9ce, SEEK_SET);
|
||||
if(fseek(file, 0x9ce, SEEK_SET)<0)
|
||||
{
|
||||
fclose(file);
|
||||
return ;
|
||||
}
|
||||
buffer_size=fread(buffer, 1, sizeof(buffer), file);
|
||||
fclose(file);
|
||||
if(buffer_size > 0)
|
||||
file_rename(old_filename, buffer, buffer_size, 0, "pzh", 0);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user