소스 검색

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 13 년 전
부모
커밋
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);