mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
Add null checks for filename and image_stream in aaruf_identify functions
This commit is contained in:
@@ -83,6 +83,8 @@
|
||||
*/
|
||||
int aaruf_identify(const char *filename)
|
||||
{
|
||||
if(filename == NULL) return EINVAL;
|
||||
|
||||
FILE *stream = NULL;
|
||||
|
||||
stream = fopen(filename, "rb");
|
||||
@@ -160,7 +162,9 @@ int aaruf_identify(const char *filename)
|
||||
*/
|
||||
int aaruf_identify_stream(FILE *image_stream)
|
||||
{
|
||||
fseek(image_stream, 0, SEEK_SET);
|
||||
if(image_stream == NULL) return 0;
|
||||
|
||||
if(fseek(image_stream, 0, SEEK_SET) != 0) return 0;
|
||||
|
||||
AaruHeader header;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user