1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-15 04:28:09 -04:00

limit alignment padding to a screenful

Credit to Oss-Fuzz
This commit is contained in:
ailin-nemui 2018-02-14 15:04:16 +01:00
parent a2bc308dca
commit e289d34b9a

View File

@ -33,6 +33,8 @@
#define isarg(c) \
(i_isdigit(c) || (c) == '*' || (c) == '~' || (c) == '-')
#define ALIGN_MAX 222488
static SPECIAL_HISTORY_FUNC history_func = NULL;
static char *get_argument(char **cmd, char **arglist)
@ -300,6 +302,10 @@ static int get_alignment_args(char **data, int *align, int *flags, char *pad)
if (!parse_uint(str, &endptr, 10, &align_)) {
return FALSE;
}
/* alignment larger than supported */
if (align_ > ALIGN_MAX) {
return FALSE;
}
str = endptr;
*align = align_;