From fb088329e10664ded7f6b179edaf607735a5dca2 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 13 Jan 2020 21:46:45 +0100 Subject: [PATCH] Fixed NULL pointer dereferences in the CD-ROM image code. --- src/cdrom/cdrom_image_backend.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/cdrom/cdrom_image_backend.c b/src/cdrom/cdrom_image_backend.c index 61260b44d..f39dfe01f 100644 --- a/src/cdrom/cdrom_image_backend.c +++ b/src/cdrom/cdrom_image_backend.c @@ -9,7 +9,7 @@ * CD-ROM image file handling module, translated to C from * cdrom_dosbox.cpp. * - * Version: @(#)cdrom_image_backend.c 1.0.3 2020/01/13 + * Version: @(#)cdrom_image_backend.c 1.0.4 2020/01/13 * * Authors: Miran Grca, * Fred N. van Kempen, @@ -136,9 +136,7 @@ bin_init(const wchar_t *filename, int *error) track_file_t *tf = (track_file_t *) malloc(sizeof(track_file_t)); if (tf == NULL) { - tf->read = NULL; - tf->get_length = NULL; - tf->close = NULL; + *error = 1; return NULL; } @@ -157,9 +155,6 @@ bin_init(const wchar_t *filename, int *error) } else { free(tf); tf = NULL; - tf->read = NULL; - tf->get_length = NULL; - tf->close = NULL; } return tf;