summaryrefslogtreecommitdiff
path: root/src/core/special-vars.c
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2018-02-14 21:21:24 +0100
committerGitHub <noreply@github.com>2018-02-14 21:21:24 +0100
commitdd2e3e6d1c619e7ff2fae5bef4e31fe3c9342722 (patch)
tree87af357c9c7abdd7c4c8dbac1dbb5f4813b214a1 /src/core/special-vars.c
parenta2bc308dca885c294d6f63e12b6353115a0f38fe (diff)
parente289d34b9a50b46f57698980e899b71f0069abda (diff)
downloadirssi-dd2e3e6d1c619e7ff2fae5bef4e31fe3c9342722.zip
Merge pull request #848 from ailin-nemui/align-exhaust
limit alignment padding to a screenful
Diffstat (limited to 'src/core/special-vars.c')
-rw-r--r--src/core/special-vars.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/special-vars.c b/src/core/special-vars.c
index e131b0ed..33d9cd55 100644
--- a/src/core/special-vars.c
+++ b/src/core/special-vars.c
@@ -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_;