slight bounds checking
This commit is contained in:
@@ -60,6 +60,9 @@ void user_interactions() {
|
||||
memset(input, 0, INPUT_BUFFER_SIZE);
|
||||
input_pass = 0;
|
||||
}
|
||||
if (input_pass >= INPUT_BUFFER_SIZE) {
|
||||
input_pass = INPUT_BUFFER_SIZE - 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -158,6 +161,9 @@ char read_string_loop(WINDOW *win, char *buffer, char *nullable_return_char, uns
|
||||
|
||||
|
||||
}
|
||||
if (*pass >= INPUT_BUFFER_SIZE) {
|
||||
*pass = INPUT_BUFFER_SIZE - 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user