Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Commit

Permalink
classic-ui: fixed host and service names are not allowed to have a '+…
Browse files Browse the repository at this point in the history
…' included #1843

refs: #1843

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

whatthecommit: We should delete this crap before shipping.
  • Loading branch information
bb-Ricardo authored and Michael Friedrich committed Apr 30, 2013
1 parent f791f06 commit 988b80f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions cgi/getcgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down Expand Up @@ -217,6 +218,7 @@ char **getcgivars(void) {
exit(1);
}
cgiinput[content_length] = '\0';

} else {

printf("getcgivars(): Unsupported REQUEST_METHOD -> '%s'\n", request_method);
Expand Down Expand Up @@ -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 */
Expand All @@ -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]);
Expand Down

0 comments on commit 988b80f

Please sign in to comment.