view: fix buffer overflow when dealing with combining characters
commit1c4e0940938373580cf1e3d2184bae8f25259b79
authorMarc André Tanner <mat@brain-dump.org>
Sun, 11 Mar 2018 23:03:52 +0000 (12 00:03 +0100)
committerMarc André Tanner <mat@brain-dump.org>
Sun, 11 Mar 2018 23:21:45 +0000 (12 00:21 +0100)
tree91689b8ee6785160c0631cbdaafebe7a581d884e
parentae6c3801292c0279a6263ce2b363d0719a0737da
view: fix buffer overflow when dealing with combining characters

The `cell.len` attribute refers to the number of bytes of the underlying
text which are represented by this cell. The actual NUL terminated data
being displayed can have a completely unrelated length.

For example a NUL byte has a `cell.len` of 1, but is displayed as
`cell.data = "^@"`.

Because we currently have a fixed cell capacity of 16 bytes (including
the terminating NUL byte) long sequences of combining characters won't
be displayed correctly.

See also #679
view.c