This commit is contained in:
Dan Robertson 2018-02-11 04:05:14 +00:00 committed by GitHub
commit 3fe8e0fc76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -36,7 +36,7 @@ char *read_line(FILE *file) {
}
string[length++] = c;
}
if (length + 1 == size) {
if (length + 1 >= size) {
char *new_string = realloc(string, length + 1);
if (!new_string) {
free(string);

View file

@ -172,6 +172,7 @@ void notify_key(enum wl_keyboard_key_state state, xkb_keysym_t sym, uint32_t cod
redraw_screen = 1;
password_size = 1024;
free(password);
password = malloc(password_size);
password[0] = '\0';
break;