Mercurial > vim
comparison src/version.c @ 14784:0745e2cd4606 v8.1.0404
patch 8.1.0404: accessing invalid memory with long argument name
commit https://github.com/vim/vim/commit/e961cba3cb8281c47f1dc2c2bc031b07504f17d4
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Sep 18 21:51:47 2018 +0200
patch 8.1.0404: accessing invalid memory with long argument name
Problem: Accessing invalid memory with long argument name.
Solution: Use item_count instead of checking for a terminating NULL.
(Dominique Pelle, closes #3444)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 18 Sep 2018 22:00:09 +0200 |
parents | d2aea794a681 |
children | 11978f68a8c3 |
comparison
equal
deleted
inserted
replaced
14783:382b629454f5 | 14784:0745e2cd4606 |
---|---|
793 }; | 793 }; |
794 | 794 |
795 static int included_patches[] = | 795 static int included_patches[] = |
796 { /* Add new patch number below this line */ | 796 { /* Add new patch number below this line */ |
797 /**/ | 797 /**/ |
798 404, | |
799 /**/ | |
798 403, | 800 403, |
799 /**/ | 801 /**/ |
800 402, | 802 402, |
801 /**/ | 803 /**/ |
802 401, | 804 401, |
1723 width += 1; | 1725 width += 1; |
1724 | 1726 |
1725 if (Columns < width) | 1727 if (Columns < width) |
1726 { | 1728 { |
1727 /* Not enough screen columns - show one per line */ | 1729 /* Not enough screen columns - show one per line */ |
1728 for (i = 0; items[i] != NULL; ++i) | 1730 for (i = 0; i < item_count; ++i) |
1729 { | 1731 { |
1730 version_msg_wrap(items[i], i == current); | 1732 version_msg_wrap(items[i], i == current); |
1731 if (msg_col > 0) | 1733 if (msg_col > 0) |
1732 msg_putchar('\n'); | 1734 msg_putchar('\n'); |
1733 } | 1735 } |