res_pjsip_header_funcs.c: Check URI parameter length before copying.
Fixes #477
(cherry picked from commit 002d6c2108
)
This commit is contained in:
parent
1c617f9b01
commit
fb289b0bad
|
@ -1098,8 +1098,10 @@ static int read_param(void *obj)
|
|||
|
||||
ast_debug(2, "Successfully read %s parameter %s (length %zu)\n",
|
||||
data->paramtype == PARAMETER_URI ? "URI" : "header", data->param_name, param_len);
|
||||
ast_copy_string(data->buf, pj_strbuf(¶m->value), data->len);
|
||||
data->buf[pj_strlen(¶m->value)] = '\0';
|
||||
if (param_len) {
|
||||
ast_copy_string(data->buf, pj_strbuf(¶m->value), data->len);
|
||||
}
|
||||
data->buf[param_len] = '\0';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue