From b70f5a90413535763c5211074f12634c13d8c9f6 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 5 Oct 2010 18:00:52 +0000 Subject: [PATCH] Fixed a potential SIGSEGV by pointer offset -1. Detected by valgrind. --- xorriso/iso_manip.c | 6 ++++-- xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xorriso/iso_manip.c b/xorriso/iso_manip.c index f3561aff..726d1e5e 100644 --- a/xorriso/iso_manip.c +++ b/xorriso/iso_manip.c @@ -304,8 +304,10 @@ cannot_open_dir:; name= disk_path+strlen(disk_path); if(Sfile_str(img_path, img_dir_path, 0)<=0) {ret= -1; goto ex;} - if(img_path[0] || img_path[strlen(img_path)-1]!='/') - strcat(img_path,"/"); + if(img_path[0] == 0) + strcat(img_path, "/"); + else if(img_path[strlen(img_path) - 1] != '/') + strcat(img_path, "/"); img_name= img_path+strlen(img_path); while(1) { /* loop over directory content */ diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 0ce32ab9..bcee5911 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2010.10.04.155226" +#define Xorriso_timestamP "2010.10.05.180016"