# HG changeset patch # User Waqas Hussain # Date 1381439896 14400 # Node ID 22b1d18eb9199e2e22b7acd3dee2d96697fbaf18 # Parent 3ee3d79db18c2c393532f57497819ab79726215c util.windows: Incorrect output buffer size passed to ReadConsoleOutputAttribute (fixes issue#362, thanks yanjun). diff -r 3ee3d79db18c -r 22b1d18eb919 util-src/windows.c --- 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;