From a26df9c49fde2cda09e7ab9759bb6fde0b787e00 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 27 Apr 2024 18:53:40 +0200 Subject: [PATCH] Bug fix: Command -truncate_overwritable on ISO image without MD5 caused double free of memory --- xorriso/sfile.h | 1 + xorriso/write_run.c | 2 +- xorriso/xorriso_timestamp.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/xorriso/sfile.h b/xorriso/sfile.h index 4ca2ea49..5b0f26fe 100644 --- a/xorriso/sfile.h +++ b/xorriso/sfile.h @@ -27,6 +27,7 @@ #define Xorriso_free_meM(pt) { \ if(pt != NULL) \ free((char *) pt); \ + pt= NULL; \ } diff --git a/xorriso/write_run.c b/xorriso/write_run.c index 99eed8d2..e3bcafd7 100644 --- a/xorriso/write_run.c +++ b/xorriso/write_run.c @@ -3616,7 +3616,7 @@ int Xorriso_adjust_relocated_sb(struct XorrisO *xorriso, if(ret <= 0) goto ex; ret= Xorriso_find_sb_checksum(xorriso, buffer, &vd_end, 0); - if(ret <= 0) + if(ret < 0) goto ex; if(ret > 0) { checksum_block= ret - 1; diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index eea5508c..9b57d962 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2024.04.27.165051" +#define Xorriso_timestamP "2024.04.27.165316"