Skip to content

Commit

Permalink
tm: safety check not to allocate 0 bytes in rpc command
Browse files Browse the repository at this point in the history
(cherry picked from commit 88b6757)
  • Loading branch information
miconda committed May 19, 2015
1 parent 7cb9428 commit 3fd7f81
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/tm/rpc_uac.c
Expand Up @@ -218,7 +218,12 @@ static char *get_hfblock(str *uri, struct hdr_field *hf, int proto,
DBG("get_hfblock: one more hf processed\n");
} /* header loop */

/* construct a single header block now */
if(total_len==0) {
LM_DBG("empty result for headers block\n");
goto error;
}

/* construct a single header block now */
ret = pkg_malloc(total_len);
if (!ret) {
LOG(L_ERR, "get_hfblock: no pkg mem for hf block\n");
Expand Down

0 comments on commit 3fd7f81

Please sign in to comment.