Skip to content

Commit

Permalink
app_rpt.c: Fix issue 469 - truncated link list in RPT_LINK
Browse files Browse the repository at this point in the history
  • Loading branch information
mkmer committed Jan 27, 2025
1 parent e4dee90 commit 7d2be48
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions apps/app_rpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1661,14 +1661,17 @@ static inline void init_text_frame(struct ast_frame *wf)

static void handle_link_data(struct rpt *myrpt, struct rpt_link *mylink, char *str)
{
char tmp[512], tmp1[512], cmd[300] = "", dest[300], src[30], c;
char tmp[MAXLINKLIST], tmp1[512], cmd[300] = "", dest[300], src[30], c;
int i, seq, res, ts, rest;
struct ast_frame wf;

init_text_frame(&wf);
wf.datalen = strlen(str) + 1;
wf.src = "handle_link_data";
/* put string in our buffer */
if (strlen(str) > sizeof(tmp)){
ast_log(LOG_WARNING,"Link text message data has exceeded tmp buffer size");
}
ast_copy_string(tmp, str, sizeof(tmp) - 1);

ast_debug(5, "Received text over link: '%s'\n", str);
Expand Down Expand Up @@ -2139,10 +2142,13 @@ static int handle_remote_dtmf_digit(struct rpt *myrpt, char c, char *keyed, int

static int handle_remote_data(struct rpt *myrpt, char *str)
{
char tmp[300], cmd[300], dest[300], src[300], c;
char tmp[MAXLINKLIST], cmd[300], dest[300], src[300], c;
int seq, res;

/* put string in our buffer */
if (strlen(str) > sizeof(tmp)){
ast_log(LOG_WARNING,"Remove link text message data has exceeded tmp buffer size");
}
ast_copy_string(tmp, str, sizeof(tmp));
if (!strcmp(tmp, DISCSTR))
return 0;
Expand Down

0 comments on commit 7d2be48

Please sign in to comment.