[icinga-checkins] icinga.org: icinga-core/next: classic-ui: fixed host and service names are not allowed to have a '+' included #1843

git at icinga.org git at icinga.org
Tue Apr 30 11:03:38 CEST 2013


Module: icinga-core
Branch: next
Commit: 988b80fbfbe0e7ba48d396a1f2f367a907bb4c35
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=988b80fbfbe0e7ba48d396a1f2f367a907bb4c35

Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date:   Tue Apr 30 10:13:50 2013 +0200

classic-ui: fixed host and service names are not allowed to have a '+' included #1843

refs: #1843

fixed again, broke with a commit in january this year.

whatthecommit: We should delete this crap before shipping.

---

 Changelog    |    1 +
 cgi/getcgi.c |   10 +++++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/Changelog b/Changelog
index cc56862..8c580a3 100644
--- a/Changelog
+++ b/Changelog
@@ -89,6 +89,7 @@ FIXES
 * classic ui: fixed Command expansion problem with percentage signs #3929 - RB
 * classic ui: cleaned up the jquery-ui includes to allow debian pkg dependencies #3808 - RB
 * classic ui: fixed Trigger Time in Scheduled Downtime displaying 01-01-1970 01:00:00 when not triggered #3980 - RB
+* classic-ui: fixed host and service names are not allowed to have a '+' included #1843 - RB
 
 * idoutils: fix many memory leaks in ido2db on dbi_result_free and others (thx Klaus Wagner) #3406 - MF
 * idoutils: fix ido2db crashes when Oracle queries fail #3324 - GB
diff --git a/cgi/getcgi.c b/cgi/getcgi.c
index 1364b94..eb45c16 100644
--- a/cgi/getcgi.c
+++ b/cgi/getcgi.c
@@ -172,12 +172,13 @@ char **getcgivars(void) {
 			if (cgiinput != NULL) {
 				cgiinput[0] = '\x0';
 			}
-		} else
+		} else {
 			cgiinput = strdup(getenv("QUERY_STRING"));
 			if (cgiinput == NULL) {
 				printf("getcgivars(): Could not allocate memory for CGI input.\n");
 				exit(1);
 			}
+		}
 	}
 
 	else if (!strcmp(request_method, "POST") || !strcmp(request_method, "PUT")) {
@@ -217,6 +218,7 @@ char **getcgivars(void) {
 			exit(1);
 		}
 		cgiinput[content_length] = '\0';
+
 	} else {
 
 		printf("getcgivars(): Unsupported REQUEST_METHOD -> '%s'\n", request_method);
@@ -272,6 +274,7 @@ char **getcgivars(void) {
 		printf("getcgivars(): Could not allocate memory for name-value list.\n");
 		exit(1);
 	}
+
 	for (i = 0; i < paircount; i++) {
 
 		/* get the variable name preceding the equal (=) sign */
@@ -283,13 +286,14 @@ char **getcgivars(void) {
 				exit(1);
 			}
 			unescape_cgi_input(cgivars[i*2+1]);
-		} else
+
+		} else {
 			cgivars[i*2+1] = strdup("");
 			if(cgivars[i*2+1] == NULL) {
 				printf("getcgivars(): Could not allocate memory for empty cgi param value #%d.\n", i);
 				exit(1);
 			}
-			unescape_cgi_input(cgivars[i*2+1]);
+		}
 
 		/* get the variable value (or name/value of there was no real "pair" in the first place) */
 		cgivars[i*2] = strdup(pairlist[i]);





More information about the icinga-checkins mailing list