From 41f75ea21fb60bf007cde83cccb8c8443d2d27c4 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Fri, 27 Mar 2009 14:43:43 +0100 Subject: [PATCH] Fixed a SIGSEGV in iso_file_get_old_image_sections() with a IsoFile from the old session which has not FSrcStreamData attached to its IsoStream. --- libisofs/fs_image.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libisofs/fs_image.c b/libisofs/fs_image.c index ec8184d..4b3f4e2 100644 --- a/libisofs/fs_image.c +++ b/libisofs/fs_image.c @@ -3229,8 +3229,19 @@ int iso_file_get_old_image_sections(IsoFile *file, int *section_count, * to get the sections. This break encapsultation, but safes memory as * we don't need to store the sections in the IsoFile node. */ - FSrcStreamData *data = file->stream->data; - ImageFileSourceData *ifsdata = data->src->data; + IsoStream *stream = file->stream; + FSrcStreamData *data; + ImageFileSourceData *ifsdata; + + /* <<< ts A90327 : provisory patch on SIGSEGV */ + if (stream->class->type[0] != 'f' || stream->class->type[1] != 's' || + stream->class->type[2] != 'r' || stream->class->type[3] != 'c') + return 0; + + /* >>> need a method to get the most original stream */ + + data = file->stream->data; + ifsdata = data->src->data; *section_count = ifsdata->nsections; *sections = malloc(ifsdata->nsections *