Software /
code /
prosody
Diff
util-src/windows.c @ 5864:22b1d18eb919
util.windows: Incorrect output buffer size passed to ReadConsoleOutputAttribute (fixes issue#362, thanks yanjun).
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 10 Oct 2013 17:18:16 -0400 |
parent | 4128:b6d072a3668d |
child | 6411:6c8f6364bc48 |
line wrap: on
line diff
--- a/util-src/windows.c Sat Oct 05 17:11:16 2013 +0100 +++ b/util-src/windows.c Thu Oct 10 17:18:16 2013 -0400 @@ -58,7 +58,7 @@ if (console == INVALID_HANDLE_VALUE) return lerror(L, "GetStdHandle"); if (!GetConsoleScreenBufferInfo(console, &info)) return lerror(L, "GetConsoleScreenBufferInfo"); - if (!ReadConsoleOutputAttribute(console, &color, sizeof(WORD), info.dwCursorPosition, &read_len)) return lerror(L, "ReadConsoleOutputAttribute"); + if (!ReadConsoleOutputAttribute(console, &color, 1, info.dwCursorPosition, &read_len)) return lerror(L, "ReadConsoleOutputAttribute"); lua_pushnumber(L, color); return 1;