diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-10-18 14:19:14 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-18 14:19:14 +0900 |
commit | 4bf90c17408ef3ae4d601e455131dd53967ea884 (patch) | |
tree | 649e88639bd4d32822f722680a8a1b157e79da0c | |
parent | 3c905ddd18db8b4bfe53c0067204addb3035e465 (diff) | |
parent | 97487ea11a2c68934927e515616c133e543a72ce (diff) | |
download | git-4bf90c17408ef3ae4d601e455131dd53967ea884.tar.gz git-4bf90c17408ef3ae4d601e455131dd53967ea884.tar.xz |
Merge branch 'rs/qsort-s' into maint
* rs/qsort-s:
test-stringlist: avoid buffer underrun when sorting nothing
-rw-r--r-- | t/helper/test-string-list.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/t/helper/test-string-list.c b/t/helper/test-string-list.c index c502fa16d..829ec3d7d 100644 --- a/t/helper/test-string-list.c +++ b/t/helper/test-string-list.c @@ -108,7 +108,7 @@ int cmd_main(int argc, const char **argv) * Split by newline, but don't create a string_list item * for the empty string after the last separator. */ - if (sb.buf[sb.len - 1] == '\n') + if (sb.len && sb.buf[sb.len - 1] == '\n') strbuf_setlen(&sb, sb.len - 1); string_list_split_in_place(&list, sb.buf, '\n', -1); |