Module: sip-router Branch: master Commit: afd800bd67c3dd54db69a5c24e0a8bd362609061 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=afd800bd...
Author: Jan Janak jan@ryngle.com Committer: Jan Janak jan@ryngle.com Date: Tue Mar 2 16:03:42 2010 -0500
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.
---
parser/parse_param.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/parser/parse_param.c b/parser/parse_param.c index f86d1c9..c68e237 100644 --- a/parser/parse_param.c +++ b/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");