Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-10-18 08:19:14 +0300
committerJunio C Hamano <gitster@pobox.com>2017-10-18 08:19:14 +0300
commit4bf90c17408ef3ae4d601e455131dd53967ea884 (patch)
tree649e88639bd4d32822f722680a8a1b157e79da0c
parent3c905ddd18db8b4bfe53c0067204addb3035e465 (diff)
parent97487ea11a2c68934927e515616c133e543a72ce (diff)
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/helper/test-string-list.c b/t/helper/test-string-list.c
index c502fa16d3..829ec3d7d2 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);