git://git.iain.cx/iain
/
nssm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed buffer overflow in GUI browse().
[nssm.git]
/
event.cpp
diff --git
a/event.cpp
b/event.cpp
index
a409b11
..
b44482c
100644
(file)
--- a/
event.cpp
+++ b/
event.cpp
@@
-1,5
+1,6
@@
#include "nssm.h"
\r
\r
#include "nssm.h"
\r
\r
+#define NSSM_SOURCE _T("nssm")
\r
#define NSSM_ERROR_BUFSIZE 65535
\r
#define NSSM_NUM_EVENT_STRINGS 16
\r
unsigned long tls_index;
\r
#define NSSM_ERROR_BUFSIZE 65535
\r
#define NSSM_NUM_EVENT_STRINGS 16
\r
unsigned long tls_index;
\r
@@
-42,7
+43,7
@@
void log_event(unsigned short type, unsigned long id, ...) {
TCHAR *strings[NSSM_NUM_EVENT_STRINGS];
\r
\r
/* Open event log */
\r
TCHAR *strings[NSSM_NUM_EVENT_STRINGS];
\r
\r
/* Open event log */
\r
- HANDLE handle = RegisterEventSource(0, NSSM);
\r
+ HANDLE handle = RegisterEventSource(0, NSSM
_SOURCE
);
\r
if (! handle) return;
\r
\r
/* Log it */
\r
if (! handle) return;
\r
\r
/* Log it */
\r
@@
-80,7
+81,7
@@
int popup_message(HWND owner, unsigned int type, unsigned long id, ...) {
return MessageBox(0, _T("The message which was supposed to go here is missing!"), NSSM, MB_OK | MB_ICONEXCLAMATION);
\r
}
\r
\r
return MessageBox(0, _T("The message which was supposed to go here is missing!"), NSSM, MB_OK | MB_ICONEXCLAMATION);
\r
}
\r
\r
- TCHAR blurb[
1024
];
\r
+ TCHAR blurb[
NSSM_ERROR_BUFSIZE
];
\r
va_start(arg, id);
\r
if (_vsntprintf_s(blurb, _countof(blurb), _TRUNCATE, format, arg) < 0) {
\r
va_end(arg);
\r
va_start(arg, id);
\r
if (_vsntprintf_s(blurb, _countof(blurb), _TRUNCATE, format, arg) < 0) {
\r
va_end(arg);
\r