diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-09-28 10:58:20 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-09-28 10:58:20 +0200 |
| commit | 7bdfddc15768a1507b029578e408483efe51ba02 (patch) | |
| tree | 471d3fe63a73f4a735b246f2869e16c6cf0bb72b | |
| parent | e198d9e0672251f72af4cb3ccb32cdbf4d45be2d (diff) | |
| download | vis-7bdfddc15768a1507b029578e408483efe51ba02.tar.gz vis-7bdfddc15768a1507b029578e408483efe51ba02.tar.xz | |
Improve argument validation in text_insert
| -rw-r--r-- | text.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -504,6 +504,8 @@ static void change_free(Change *c) { * \-+ <-- +-----+ <-- +---------------+ <-- +-/ */ bool text_insert(Text *txt, size_t pos, const char *data, size_t len) { + if (len == 0) + return true; if (pos > txt->size) return false; if (pos < txt->lines.pos) |
