From 75b4c66de64c17bb0d6a46872c0505f3db2371c5 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 19 Nov 2004 15:02:08 +0000 Subject: [PATCH] fixed an access violation in case of a script jump beyond the last entry git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3772 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/build.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/build.cpp b/Source/build.cpp index 6a7b5d82..f92cfa4c 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -1305,6 +1305,7 @@ int CEXEBuild::resolve_jump_int(const char *fn, int *a, int offs, int start, int { int jump = atoi(lname); int *skip_map = (int *) cur_instruction_entry_map->get(); + int maxoffs = cur_instruction_entry_map->getlen() / (int) sizeof(int); int direction = 1; if (jump < 0) @@ -1313,7 +1314,7 @@ int CEXEBuild::resolve_jump_int(const char *fn, int *a, int offs, int start, int for (; jump != 0; jump -= direction) { offs += direction; - if (offs >= 0 && offs < cur_instruction_entry_map->getlen() * (int) sizeof(int)) + if (offs >= 0 && offs < maxoffs) { while (skip_map[offs]) {