diff options
author | Duncaen <mail@duncano.de> | 2019-01-28 16:24:01 +0100 |
---|---|---|
committer | Duncaen <mail@duncano.de> | 2019-02-08 19:55:47 +0100 |
commit | cfba3e1c3b79eb9bb67e8e4959b39e4d9723da60 (patch) | |
tree | e3cca2dcdb9452fdea088efd7278eee6d75056e6 | |
parent | 820c07b7e410200f7d0b93069103250719a38636 (diff) | |
download | mblaze-cfba3e1c3b79eb9bb67e8e4959b39e4d9723da60.tar.gz mblaze-cfba3e1c3b79eb9bb67e8e4959b39e4d9723da60.tar.xz mblaze-cfba3e1c3b79eb9bb67e8e4959b39e4d9723da60.zip |
mpick: fix off-by-one in parse_string (expression parsing) v0.5
-rw-r--r-- | NEWS.md | 1 | ||||
-rw-r--r-- | mpick.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/NEWS.md b/NEWS.md index b5f1fbb..97c172f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -14,6 +14,7 @@ * mscan: new flag -v for statistics * magrep: add -h, which is like -p but doesn't print the file name * mscan: prioritize displaying trashed mail over other markers +* mpick: fix off-by-one in expression parsing * Many bug fixes ## 0.4 (2018-08-15) diff --git a/mpick.c b/mpick.c index b412f8e..1704044 100644 --- a/mpick.c +++ b/mpick.c @@ -284,7 +284,7 @@ parse_string(char **s) pos++; while (*pos && (*pos != '"' || (*pos == '"' && *(pos+1) == '"'))) { - if (len >= bufsiz) { + if (len+1 >= bufsiz) { bufsiz = 2*bufsiz + 16; buf = realloc(buf, bufsiz); if (!buf) |