[Openvas-commits] r6082 - in trunk/gsa: . src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Dec 7 16:57:00 CET 2009


Author: mwiegand
Date: 2009-12-07 16:57:00 +0100 (Mon, 07 Dec 2009)
New Revision: 6082

Modified:
   trunk/gsa/ChangeLog
   trunk/gsa/src/gsad.c
Log:
Fixed a bug which caused the GSA to hang or crash when editing the
configuration for a family containing ":".

* src/gsad.c (init_validator): Added / fixed regular expressions for
family names.
(exec_omp_post): Repaired validator usage.


Modified: trunk/gsa/ChangeLog
===================================================================
--- trunk/gsa/ChangeLog	2009-12-07 15:17:12 UTC (rev 6081)
+++ trunk/gsa/ChangeLog	2009-12-07 15:57:00 UTC (rev 6082)
@@ -1,3 +1,12 @@
+2009-12-07  Michael Wiegand <michael.wiegand at intevation.de>
+
+	Fixed a bug which caused the GSA to hang or crash when editing the
+	configuration for a family containing ":".
+
+	* src/gsad.c (init_validator): Added / fixed regular expressions for
+	family names.
+	(exec_omp_post): Repaired validator usage.
+
 2009-12-07  Felix Wolfsteller <felix.wolfsteller at intevation.de>
 
 	* CMakeLists.txt: Improved checks for pkg-config and libopenvas-config,

Modified: trunk/gsa/src/gsad.c
===================================================================
--- trunk/gsa/src/gsad.c	2009-12-07 15:17:12 UTC (rev 6081)
+++ trunk/gsa/src/gsad.c	2009-12-07 15:57:00 UTC (rev 6082)
@@ -194,7 +194,7 @@
   openvas_validator_add (validator, "boolean",    "^0|1$");
   openvas_validator_add (validator, "comment",    "^[-_[:alnum:], \\./]{0,400}$");
   openvas_validator_add (validator, "create_credentials_type", "^(gen|pass)$");
-  openvas_validator_add (validator, "family",     "^[-_[:alnum:] ]{1,200}$");
+  openvas_validator_add (validator, "family",     "^[-_[:alnum:] :]{1,200}$");
   openvas_validator_add (validator, "first_result", "^[0-9]+$");
   openvas_validator_add (validator, "format",     "^(html)|(nbe)|(pdf)|(xml)$");
   openvas_validator_add (validator, "hosts",      "^[[:alnum:], \\./]{1,80}$");
@@ -204,6 +204,7 @@
   openvas_validator_add (validator, "name",       "^[-_[:alnum:], \\./]{1,80}$");
   openvas_validator_add (validator, "oid",        "^[0-9.]{1,80}$");
   openvas_validator_add (validator, "page",       "^[_[:alnum:] ]{1,40}$");
+  openvas_validator_add (validator, "family_page", "^[_[:alnum:] :]{1,40}$");
   openvas_validator_add (validator, "package_format", "^(key)|(rpm)|(deb)|(exe)$");
   openvas_validator_add (validator, "password",   "^[[:alnum:], \\./]{0,40}$");
   /** @todo Better regex. */
@@ -1159,10 +1160,10 @@
           free (con_info->req_parms.name);
           con_info->req_parms.name = NULL;
         }
-      if (openvas_validate (validator, "page", con_info->req_parms.submit))
+      if (openvas_validate (validator, "family_page", con_info->req_parms.submit))
         {
           free (con_info->req_parms.submit);
-          con_info->req_parms.name = NULL;
+          con_info->req_parms.submit = NULL;
         }
       con_info->response =
         save_config_omp (credentials,
@@ -1183,8 +1184,8 @@
         }
       if (openvas_validate (validator, "family", con_info->req_parms.family))
         {
-          free (con_info->req_parms.name);
-          con_info->req_parms.name = NULL;
+          free (con_info->req_parms.family);
+          con_info->req_parms.family = NULL;
         }
       con_info->response =
         save_config_family_omp (credentials,
@@ -1203,8 +1204,8 @@
         }
       if (openvas_validate (validator, "family", con_info->req_parms.family))
         {
-          free (con_info->req_parms.name);
-          con_info->req_parms.name = NULL;
+          free (con_info->req_parms.family);
+          con_info->req_parms.family = NULL;
         }
       if (openvas_validate (validator, "oid", con_info->req_parms.oid))
         {



More information about the Openvas-commits mailing list