From 778f157b688a66c8835203d6062e250bf4716981 Mon Sep 17 00:00:00 2001 From: kichik Date: Mon, 30 Sep 2002 17:22:48 +0000 Subject: [PATCH] Prevent possible crash git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1230 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/lang.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/lang.cpp b/Source/lang.cpp index d48392ff..a6fbd66c 100644 --- a/Source/lang.cpp +++ b/Source/lang.cpp @@ -305,7 +305,10 @@ void CEXEBuild::FillDefaultsIfNeeded(StringTable *table, NLF *nlf/*=0*/) { int iscp=0; for (x = 0; x < build_header.num_sections&&!iscp; x ++) { - char c=build_strlist.get()[((section*)build_sections.get())[x].name_ptr]; + int name_ptr = ((section*)build_sections.get())[x].name_ptr; + char c; + if (name_ptr < 0) c = 'a'; + else char c=build_strlist.get()[((section*)build_sections.get())[x].name_ptr]; if (c && c != '-' && !(((section*)build_sections.get())[x].default_state&DFS_RO)) iscp++; } if (iscp)