Skip to content

Commit

Permalink
Version 1.0.48.05
Browse files Browse the repository at this point in the history
Fixed crash of SendMessage and PostMessage when wParam or lParam is omitted (broken by 1.0.48.04). [thanks Lexikos]
  • Loading branch information
Chris Mallett committed Sep 25, 2009
1 parent de593ae commit db43da8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Source/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ GNU General Public License for more details.
#endif

#define NAME_P "AutoHotkey"
#define NAME_VERSION "1.0.48.04"
#define NAME_VERSION "1.0.48.05"
#define NAME_PV NAME_P " v" NAME_VERSION

// Window class names: Changing these may result in new versions not being able to detect any old instances
Expand Down
2 changes: 1 addition & 1 deletion Source/resources/AutoHotkey.exe.manifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.48.04"
version="1.0.48.05"
processorArchitecture="X86"
name="Microsoft.Windows.AutoHotkey"
type="win32"
Expand Down
12 changes: 6 additions & 6 deletions Source/resources/AutoHotkey.rc
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,48,04
PRODUCTVERSION 1,0,48,04
FILEVERSION 1,0,48,05
PRODUCTVERSION 1,0,48,05
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -167,20 +167,20 @@ BEGIN
BEGIN
#ifdef AUTOHOTKEYSC
VALUE "FileDescription", ""
VALUE "FileVersion", "1, 0, 48, 04"
VALUE "FileVersion", "1, 0, 48, 05"
VALUE "InternalName", ""
VALUE "LegalCopyright", ""
VALUE "OriginalFilename", ""
VALUE "ProductName", ""
VALUE "ProductVersion", "1, 0, 48, 04"
VALUE "ProductVersion", "1, 0, 48, 05"
#else
VALUE "FileDescription", "AutoHotkey"
VALUE "FileVersion", "1, 0, 48, 04"
VALUE "FileVersion", "1, 0, 48, 05"
VALUE "InternalName", "AutoHotkey"
VALUE "LegalCopyright", "Copyright (C) 2009"
VALUE "OriginalFilename", "AutoHotkey.rc"
VALUE "ProductName", "AutoHotkey"
VALUE "ProductVersion", "1, 0, 48, 04"
VALUE "ProductVersion", "1, 0, 48, 05"
#endif
END
END
Expand Down
9 changes: 4 additions & 5 deletions Source/script2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2808,18 +2808,17 @@ ResultType Line::ScriptPostSendMessage(bool aUseSend)
// v1.0.43.06: If either wParam or lParam contained the address of a variable, update the mLength
// member after sending the message in case the receiver of the message wrote something to the buffer.
// This is similar to the way "Str" parameters work in DllCall.
Var *var_to_update[2];
Var *var_to_update[2] = {NULL}; // v1.0.48.05: Fixed to initialize to NULL, which prevents crash when wParam and/or lParam is omitted.
int i;
for (i = 1; i < 3; ++i) // Two iterations: wParam and lParam.
{
if (mArgc > i) // The arg exists.
{
ArgStruct &this_arg = mArg[i];
var_to_update[i-1] = this_arg.text[0] == '&' // Must start with '&', so things like 5+&MyVar aren't supported.
if ( this_arg.text[0] == '&' // Must start with '&', so things like 5+&MyVar aren't supported.
&& this_arg.deref && !this_arg.deref->is_function
&& this_arg.deref->var->Type() == VAR_NORMAL // Check VAR_NORMAL to be extra-certain it can't be the clipboard or a built-in variable (ExpandExpression() probably prevents taking the address of such a variable, but might not stop it from being in the deref array that way).
? this_arg.deref->var
: NULL;
&& this_arg.deref->var->Type() == VAR_NORMAL )
var_to_update[i-1] = this_arg.deref->var; // Check VAR_NORMAL to be extra-certain it can't be the clipboard or a built-in variable (ExpandExpression() probably prevents taking the address of such a variable, but might not stop it from being in the deref array that way).
}
}

Expand Down

1 comment on commit db43da8

@trusktr
Copy link

@trusktr trusktr commented on db43da8 Oct 5, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this. Because of AutoHotkey, WinCompose was born:
https://github.com/SamHocevar/wincompose

Please sign in to comment.