Browse Source

parse_param: Let the body point behind '=' when body is missing.

This fixes potential issues with functions that copy parameters
structures from private to shared memory because such functions
usually translate string pointers using a base pointing at the
first character of the parameter list.

Reported by Daniel.
Jan Janak 15 years ago
parent
commit
afd800bd67
1 changed files with 2 additions and 3 deletions
  1. 2 3
      parser/parse_param.c

+ 2 - 3
parser/parse_param.c

@@ -456,9 +456,8 @@ inline int parse_param(str *_s, pclass_t _c, param_hooks_t *_h, param_t *t)
 
 		if (_s->len == 0) {
 		    /* Be forgiving and accept parameters with missing value,
-		     * we just set the body of such a parameter to an empty
-		     * string. */
-		    t->body.s = "";
+		     * we just set the length of parameter body to 0. */
+		    t->body.s = _s->s;
 		    t->body.len = 0;
 		} else if (parse_param_body(_s, t) < 0) {
 			LOG(L_ERR, "parse_params(): Error while parsing param body\n");