From 0d227d45d03e6a6716065463a2a0549dc2276d45 Mon Sep 17 00:00:00 2001 From: snickerbockers Date: Tue, 30 Aug 2022 17:02:33 -0400 Subject: [PATCH] fix uninitialized chd_file in chd_read_header at the cleanup label, it checks if chd.file != NULL, but if filename or header was NULL then chd will be uninitialized i saw this as a gcc warning while building libchdr. IDK if it is causing any problems but it is definitely something that should be fixed. --- src/libchdr_chd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libchdr_chd.c b/src/libchdr_chd.c index 7d337ce..3f280ba 100644 --- a/src/libchdr_chd.c +++ b/src/libchdr_chd.c @@ -1901,7 +1901,7 @@ CHD_EXPORT const chd_header *chd_get_header(chd_file *chd) CHD_EXPORT chd_error chd_read_header(const char *filename, chd_header *header) { chd_error err = CHDERR_NONE; - chd_file chd; + chd_file chd = { }; /* punt if NULL */ if (filename == NULL || header == NULL)