diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-09-09 12:54:02 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-09 12:54:02 -0700 |
commit | 1764e8124e441a84b4764da0f8e6b0c900c44941 (patch) | |
tree | 392cc5ba3df866f718a08c5aa3e0e5e639dd62af /utf8.c | |
parent | 27fbcf8267ecc484cafdbfe84a3aaf2f373f3e2a (diff) | |
parent | 430875969a5229c1d306e4cc5acc8c8afe2b50a3 (diff) | |
download | git-1764e8124e441a84b4764da0f8e6b0c900c44941.tar.gz |
Merge branch 'nd/strbuf-utf8-replace'
* nd/strbuf-utf8-replace:
utf8.c: fix strbuf_utf8_replace() consuming data beyond input string
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -382,6 +382,9 @@ void strbuf_utf8_replace(struct strbuf *sb_src, int pos, int width, dst += n; } + if (src >= end) + break; + old = src; n = utf8_width((const char**)&src, NULL); if (!src) /* broken utf-8, do nothing */ |