From 72c2e4c2114eae0aea02f7bfab3bd10007e38c2d Mon Sep 17 00:00:00 2001 From: kichik Date: Thu, 19 Apr 2007 21:47:12 +0000 Subject: [PATCH] validate $EXEPATH as well git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5107 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/build.cpp | 8 ++++---- Source/exehead/state.h | 4 ++-- Source/exehead/util.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/build.cpp b/Source/build.cpp index ea66b474..57316cdc 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -301,10 +301,10 @@ CEXEBuild::CEXEBuild() : m_UserVarNames.add("LANGUAGE",1); // 24 m_UserVarNames.add("TEMP",-1); // 25 m_UserVarNames.add("PLUGINSDIR",-1); // 26 - m_UserVarNames.add("HWNDPARENT",-1); // 27 - m_UserVarNames.add("_CLICK",-1); // 28 - m_UserVarNames.add("_OUTDIR",1); // 29 - m_UserVarNames.add("EXEPATH",-1); // 30 + m_UserVarNames.add("EXEPATH",-1); // 27 + m_UserVarNames.add("HWNDPARENT",-1); // 28 + m_UserVarNames.add("_CLICK",-1); // 29 + m_UserVarNames.add("_OUTDIR",1); // 30 m_iBaseVarsNum = m_UserVarNames.getnum(); diff --git a/Source/exehead/state.h b/Source/exehead/state.h index f15fffab..52583eb0 100644 --- a/Source/exehead/state.h +++ b/Source/exehead/state.h @@ -27,8 +27,8 @@ extern NSIS_STRING g_usrvars[1]; #ifdef NSIS_CONFIG_PLUGIN_SUPPORT # define state_plugins_dir g_usrvars[26] #endif -#define state_click_next g_usrvars[28] -#define state_exe_path g_usrvars[30] +#define state_exe_path g_usrvars[27] +#define state_click_next g_usrvars[29] extern char g_caption[NSIS_MAX_STRLEN*2]; #ifdef NSIS_CONFIG_VISIBLE_SUPPORT diff --git a/Source/exehead/util.c b/Source/exehead/util.c index b8e7f3de..e3c6c99c 100644 --- a/Source/exehead/util.c +++ b/Source/exehead/util.c @@ -674,13 +674,13 @@ char * NSISCALL GetNSISString(char *outbuf, int strtab) } else if (nVarIdx == NS_VAR_CODE) { - if (nData == 27) // HWNDPARENT + if (nData == 28) // HWNDPARENT myitoa(out, (unsigned int) g_hwnd); else mystrcpy(out, g_usrvars[nData]); // validate the directory name - if ((unsigned int)(nData - 21) < 6) { - // validate paths for $INSTDIR, $OUTDIR, $EXEDIR, $LANGUAGE, $TEMP and $PLUGINSDIR + if ((unsigned int)(nData - 21) < 7) { + // validate paths for $INSTDIR, $OUTDIR, $EXEDIR, $LANGUAGE, $TEMP, $PLUGINSDIR and $EXEPATH // $LANGUAGE is just a number anyway... validate_filename(out); }