浏览代码

Fixed buffer length adding a service via the GUI.

The path to the monitored application and the arguments to the
application are both allowed to be sufficiently large to fit in the
maximum allowable registry value size.  The GUI itself, however, was
restricting input fields to 256 characters.
Iain Patterson 12 年之前
父节点
当前提交
a4ac5c7f00
共有 2 个文件被更改,包括 3 次插入5 次删除
  1. 3 3
      gui.cpp
  2. 0 2
      gui.h

+ 3 - 3
gui.cpp

@@ -63,9 +63,9 @@ int install(HWND window) {
   if (! window) return 1;
 
   /* Check parameters in the window */
-  char name[STRING_SIZE];
+  char name[VALUE_LENGTH];
   char exe[EXE_LENGTH];
-  char flags[STRING_SIZE];
+  char flags[VALUE_LENGTH];
 
   /* Get service name */
   if (! GetDlgItemText(window, IDC_NAME, name, sizeof(name))) {
@@ -120,7 +120,7 @@ int remove(HWND window) {
   if (! window) return 1;
 
   /* Check parameters in the window */
-  char name[STRING_SIZE];
+  char name[VALUE_LENGTH];
 
   /* Get service name */
   if (! GetDlgItemText(window, IDC_NAME, name, sizeof(name))) {

+ 0 - 2
gui.h

@@ -6,8 +6,6 @@
 #include <commctrl.h>
 #include "resource.h"
 
-#define STRING_SIZE 256
-
 int nssm_gui(int, char *);
 void centre_window(HWND);
 int install(HWND);