From 881fa61896f8c22ef94a937c0e4bf76306187b0a Mon Sep 17 00:00:00 2001 From: f0rt Date: Sun, 18 May 2014 19:32:50 +0000 Subject: [PATCH] Patch #250: Fix of mingw-w64 warnings concering out of boundary array access git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6484 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Main.c | 4 ++-- Source/exehead/state.h | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Source/exehead/Main.c b/Source/exehead/Main.c index 0111fba0..557648fa 100644 --- a/Source/exehead/Main.c +++ b/Source/exehead/Main.c @@ -247,7 +247,7 @@ EXTERN_C void NSISWinMainNOCRT() CreateDirectory(state_temp_dir,NULL); SetCurrentDirectory(state_temp_dir); - if (!state_install_directory[0]) + if (!(*state_install_directory)) mystrcpy(state_install_directory,state_exe_directory); mystrcpy(g_usrvars[0], realcmds); @@ -280,7 +280,7 @@ EXTERN_C void NSISWinMainNOCRT() } } } - g_usrvars[1][0]++; + (*(((NSIS_STRING *)g_usrvars)[1]))++; } #ifdef NSIS_SUPPORT_MOVEONREBOOT diff --git a/Source/exehead/state.h b/Source/exehead/state.h index 15de628d..2e73dc72 100644 --- a/Source/exehead/state.h +++ b/Source/exehead/state.h @@ -28,18 +28,18 @@ extern NSIS_STRING g_usrvarssection[1]; #define g_usrvars g_usrvarssection #endif -#define state_command_line g_usrvars[20] -#define state_install_directory g_usrvars[21] -#define state_output_directory g_usrvars[22] -#define state_exe_directory g_usrvars[23] -#define state_language g_usrvars[24] -#define state_temp_dir g_usrvars[25] +#define state_command_line (((NSIS_STRING *) g_usrvars)[20]) +#define state_install_directory (((NSIS_STRING *) g_usrvars)[21]) +#define state_output_directory (((NSIS_STRING *) g_usrvars)[22]) +#define state_exe_directory (((NSIS_STRING *) g_usrvars)[23]) +#define state_language (((NSIS_STRING *) g_usrvars)[24]) +#define state_temp_dir (((NSIS_STRING *) g_usrvars)[25]) #ifdef NSIS_CONFIG_PLUGIN_SUPPORT -# define state_plugins_dir g_usrvars[26] +# define state_plugins_dir (((NSIS_STRING *) g_usrvars)[26]) #endif -#define state_exe_path g_usrvars[27] -#define state_exe_file g_usrvars[28] -#define state_click_next g_usrvars[30] +#define state_exe_path (((NSIS_STRING *) g_usrvars)[27]) +#define state_exe_file (((NSIS_STRING *) g_usrvars)[28]) +#define state_click_next (((NSIS_STRING *) g_usrvars)[30]) extern TCHAR g_caption[NSIS_MAX_STRLEN*2]; #ifdef NSIS_CONFIG_VISIBLE_SUPPORT