|[AD] 4.9.2 buffer overflow?|
[ Thread Index |
| More lists.liballeg.org/allegro-developers Archives
- To: Coordination of admins/developers of the game programming library Allegro <alleg-developers@xxxxxxxxxx>
- Subject: [AD] 4.9.2 buffer overflow?
- From: AJ <aj@xxxxxxxxxx>
- Date: Tue, 29 Jan 2008 23:27:27 +1100
char *win_err_str(long err)
static char msg;
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
(LPTSTR)&msg, 0, NULL);
MSDN says that 2nd to last arg, '0' should be the length of the msg
buffer in TCHARS.
the above may have worked out of sheer luck, any message with >256
TCHARs has potential for overflow.