console: fix bug in buffer-erase helper

We didn't check for NULL line so we got segfaults when erasing empty
lines. Fix this.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-02-05 15:44:20 +01:00
parent d3951da865
commit 7c8eb3b108

View File

@ -918,6 +918,11 @@ void kmscon_buffer_erase_region(struct kmscon_buffer *buf, unsigned int x_from,
for ( ; y_from <= y_to; ++y_from) {
line = get_line(buf, y_from);
if (!line) {
x_from = 0;
continue;
}
if (y_from == y_to)
to = x_to;
else