summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2018-02-04 11:18:22 +0100
committerailin-nemui <ailin-nemui@users.noreply.github.com>2018-02-04 11:34:20 +0100
commitb33ce255a9df6e951d90f3d3c519b005dacb7010 (patch)
tree15169f7b4369be983662146624dd170f83d97494 /src
parentf0bd434eb0b0fbeaecc10c3cc355100fbf90947a (diff)
downloadirssi-b33ce255a9df6e951d90f3d3c519b005dacb7010.zip
check for negative bound
Diffstat (limited to 'src')
-rw-r--r--src/fe-text/mainwindows.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c
index fd4603da..9cc540fb 100644
--- a/src/fe-text/mainwindows.c
+++ b/src/fe-text/mainwindows.c
@@ -1263,6 +1263,7 @@ static void cmd_window_shrink(const char *data)
int count;
count = *data == '\0' ? 1 : atoi(data);
+ if (count < -INT_MAX) count = -INT_MAX;
mainwindow_grow_int(-count);
}
@@ -1277,6 +1278,7 @@ static void cmd_window_size(const char *data)
size -= WINDOW_MAIN(active_win)->height -
WINDOW_MAIN(active_win)->statusbar_lines;
+ if (size < -INT_MAX) size = -INT_MAX;
mainwindow_grow_int(size);
}
@@ -1460,6 +1462,7 @@ static void cmd_window_rshrink(const char *data)
int count;
count = *data == '\0' ? 1 : atoi(data);
+ if (count < -INT_MAX) count = -INT_MAX;
window_rgrow_int(-count);
}