mirror of https://github.com/crash-utility/crash
When the is_s390_dump() function is called to determine whether
a file is an s390 dumpfile, it currently presumes that the fopen() call always works, and then tries to read it with using a NULL file pointer. Change it to verify that the fopen() was successful, and if not, print an error message as is done with the other dumpfile type verifier functions. (ramin.blackhat@gmail.com)
This commit is contained in:
parent
9166dd323f
commit
31418015ee
|
@ -30,6 +30,10 @@ is_s390_dump(char *file)
|
|||
int rc;
|
||||
|
||||
fh = fopen(file,"r");
|
||||
if (fh == NULL) {
|
||||
error(INFO, "is_s390_dump: cannot open %s: %s\n", file);
|
||||
return FALSE;
|
||||
}
|
||||
items = fread(&magic, sizeof(magic), 1,fh);
|
||||
if(magic == 0xa8190173618f23fdLL)
|
||||
rc = TRUE;
|
||||
|
|
Loading…
Reference in New Issue