aboutsummaryrefslogtreecommitdiffstats
path: root/util-src/windows.c
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2013-10-10 17:18:16 -0400
committerWaqas Hussain <waqas20@gmail.com>2013-10-10 17:18:16 -0400
commit6dc1bb826a8455ef260c7cd7a8c65e448bfdea94 (patch)
treef4f24a4a73d024ab28c0f4013d1f678c7817b8f9 /util-src/windows.c
parentc4ff2e7bd53a2b4083ba6a2c5ae0eda263289c31 (diff)
downloadprosody-6dc1bb826a8455ef260c7cd7a8c65e448bfdea94.tar.gz
prosody-6dc1bb826a8455ef260c7cd7a8c65e448bfdea94.zip
util.windows: Incorrect output buffer size passed to ReadConsoleOutputAttribute (fixes issue#362, thanks yanjun).
Diffstat (limited to 'util-src/windows.c')
-rw-r--r--util-src/windows.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util-src/windows.c b/util-src/windows.c
index 121cc471..3d14ca95 100644
--- a/util-src/windows.c
+++ b/util-src/windows.c
@@ -58,7 +58,7 @@ static int Lget_consolecolor(lua_State *L) {
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;