Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #464 from RichardHitt/bufoflo
Browse files Browse the repository at this point in the history
Truncate text if too long.  Closes Issue #463
  • Loading branch information
TingPing committed Mar 23, 2013
2 parents c99e7f8 + f7923f2 commit 8996baa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -1780,6 +1780,8 @@ format_event (session *sess, int index, char **args, char *o, int sizeofo, unsig
printf ("arg[%d] is NULL in print event\n", a + 1);
} else
{
if (strlen (ar) > sizeofo - oi - 4)
ar[sizeofo - oi - 4] = 0; /* Avoid buffer overflow */
if (stripcolor_args & ARG_FLAG(a + 1)) len = strip_color2 (ar, -1, &o[oi], STRIP_ALL);
else len = strip_hidden_attribute (ar, &o[oi]);
oi += len;
Expand Down

0 comments on commit 8996baa

Please sign in to comment.