From 92073c45efe373162971a66bb24cdd704ac227f8 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 24 Jan 2011 15:03:09 +0100 Subject: [PATCH] Bug fix: Volume Descriptor Set Terminator contained non-zero bytes in the reserved field (ECMA-119 8.3.4). The bytes stem from an uninitialized local variable. --- libisofs/ecma119.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libisofs/ecma119.c b/libisofs/ecma119.c index d967d1d..99a6dcd 100644 --- a/libisofs/ecma119.c +++ b/libisofs/ecma119.c @@ -1,7 +1,7 @@ /* * Copyright (c) 2007 Vreixo Formoso * Copyright (c) 2007 Mario Danic - * Copyright (c) 2009 - 2010 Thomas Schmitt + * Copyright (c) 2009 - 2011 Thomas Schmitt * * This file is part of the libisofs project; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 @@ -1135,6 +1135,8 @@ int write_vol_desc_terminator(Ecma119Image *target) uint8_t buf[BLOCK_SIZE]; struct ecma119_vol_desc_terminator *vol; + memset(buf, 0, BLOCK_SIZE); + vol = (struct ecma119_vol_desc_terminator *) buf; vol->vol_desc_type[0] = 255; @@ -1209,7 +1211,7 @@ int write_head_part2(Ecma119Image *target, int *write_count, int flag) return ISO_SUCCESS; /* Write multi-session padding up to target->partition_offset + 16 */ - memset(buf, 0, 2048); + memset(buf, 0, BLOCK_SIZE); for(; *write_count < target->partition_offset + 16; (*write_count)++) { res = iso_write(target, buf, BLOCK_SIZE); if (res < 0)