• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revision969d389a2e36d7daaf5fe09eb717f938fedd89d8 (tree)
Time2020-06-30 05:30:04
AuthorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 8.2.1089: Coverity warns for pointer computation

Commit: https://github.com/vim/vim/commit/927b7dd0fe9a0a82b39d600779edb4390ecdeda6
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jun 29 22:24:56 2020 +0200

patch 8.2.1089: Coverity warns for pointer computation
Problem: Coverity warns for pointer computation.
Solution: Avoid computing a pointer to invalid memory.

Change Summary

Incremental Difference

diff -r 3052a76c1a59 -r 969d389a2e36 src/spellfile.c
--- a/src/spellfile.c Mon Jun 29 21:45:05 2020 +0200
+++ b/src/spellfile.c Mon Jun 29 22:30:04 2020 +0200
@@ -5908,7 +5908,8 @@
59085908 spin.si_newcompID = 127; // start compound ID at first maximum
59095909
59105910 // default: fnames[0] is output file, following are input files
5911- innames = &fnames[1];
5911+ // When "fcount" is 1 there is only one file.
5912+ innames = &fnames[fcount == 1 ? 0 : 1];
59125913 incount = fcount - 1;
59135914
59145915 wfname = alloc(MAXPATHL);
@@ -5922,14 +5923,12 @@
59225923 {
59235924 // For ":mkspell path/en.latin1.add" output file is
59245925 // "path/en.latin1.add.spl".
5925- innames = &fnames[0];
59265926 incount = 1;
59275927 vim_snprintf((char *)wfname, MAXPATHL, "%s.spl", fnames[0]);
59285928 }
59295929 else if (fcount == 1)
59305930 {
59315931 // For ":mkspell path/vim" output file is "path/vim.latin1.spl".
5932- innames = &fnames[0];
59335932 incount = 1;
59345933 vim_snprintf((char *)wfname, MAXPATHL, SPL_FNAME_TMPL,
59355934 fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc());
diff -r 3052a76c1a59 -r 969d389a2e36 src/version.c
--- a/src/version.c Mon Jun 29 21:45:05 2020 +0200
+++ b/src/version.c Mon Jun 29 22:30:04 2020 +0200
@@ -755,6 +755,8 @@
755755 static int included_patches[] =
756756 { /* Add new patch number below this line */
757757 /**/
758+ 1089,
759+/**/
758760 1088,
759761 /**/
760762 1087,
Show on old repository browser