From eae737d71a5d7740ac18ab27f569cd65199c3f28 Mon Sep 17 00:00:00 2001 From: kichik Date: Thu, 2 Oct 2003 12:03:05 +0000 Subject: [PATCH] validate shortcut target, if it turns up as a valid path spec (URLs should still work) git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2989 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/exec.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 9eb0ff8c..7db2347d 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -978,7 +978,7 @@ static int NSISCALL ExecuteEntry(entry *entry_) case EW_CREATESHORTCUT: { char *buf2=GetStringFromParm(-0x20); - char *buf1=GetStringFromParm(0x11); + char *buf1=GetStringFromParm(-0x11); char *buf0=GetStringFromParm(0x02); char *buf3=GetStringFromParm(-0x33); char *buf4=GetStringFromParm(0x45); @@ -986,6 +986,9 @@ static int NSISCALL ExecuteEntry(entry *entry_) HRESULT hres; IShellLink* psl; + if (!validpathspec(buf1)) + GetStringFromParm(0x11); + log_printf8("CreateShortCut: out: \"%s\", in: \"%s %s\", icon: %s,%d, sw=%d, hk=%d", buf2,buf1,buf0,buf3,parm4&0xff,(parm4&0xff00)>>8,parm4>>16); @@ -1009,7 +1012,8 @@ static int NSISCALL ExecuteEntry(entry *entry_) if (SUCCEEDED(hres)) { - WCHAR wsz[1024]; + static WCHAR wsz[1024]; + wsz[0]=0; MultiByteToWideChar(CP_ACP, 0, buf2, -1, wsz, 1024); hres=ppf->lpVtbl->Save(ppf,(const WCHAR*)wsz,TRUE); }