Skip to content

Commit

Permalink
event_rabbitmq: URI-decode fields in rabbitmq socket
Browse files Browse the repository at this point in the history
Closes issue #148
  • Loading branch information
razvancrainea committed Mar 19, 2014
1 parent ff5f403 commit 0260de0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions modules/event_rabbitmq/event_rabbitmq.c
Expand Up @@ -176,18 +176,26 @@ static int rmq_match(evi_reply_sock *sock1, evi_reply_sock *sock2)

static inline int dupl_string(str* dst, const char* begin, const char* end)
{
str tmp;
if (dst->s)
shm_free(dst->s);

tmp.s = (char *)begin;
tmp.len = end - begin;

dst->s = shm_malloc(end - begin + 1);
if (!dst->s) {
LM_ERR("no more shm memory\n");
return -1;
}

memcpy(dst->s, begin, end - begin);
dst->s[end - begin] = 0;
dst->len = end - begin + 1;
if (un_escape(&tmp, dst) < 0)
return -1;

/* NULL-terminate the string */
dst->s[dst->len] = 0;
dst->len++;

return 0;
}

Expand Down

0 comments on commit 0260de0

Please sign in to comment.