Patch 8.2.3328
Problem: Coverity error for not checking return value.
Solution: Check value is not negative.
Files: src/spellfile.c
*** ../vim-8.2.3327/src/spellfile.c 2021-06-27 22:03:28.645707721 +0200
--- src/spellfile.c 2021-08-11 15:53:24.751935027 +0200
***************
*** 1258,1270 ****
gap = &slang->sl_comppat;
c = get2c(fd); // <comppatcount>
todo -= 2;
ga_init2(gap, sizeof(char_u *), c);
if (ga_grow(gap, c) == OK)
while (--c >= 0)
{
((char_u **)(gap->ga_data))[gap->ga_len++] =
! read_cnt_string(fd, 1, &cnt);
// <comppatlen> <comppattext>
if (cnt < 0)
return cnt;
--- 1258,1272 ----
gap = &slang->sl_comppat;
c = get2c(fd); // <comppatcount>
+ if (c < 0)
+ return SP_TRUNCERROR;
todo -= 2;
ga_init2(gap, sizeof(char_u *), c);
if (ga_grow(gap, c) == OK)
while (--c >= 0)
{
((char_u **)(gap->ga_data))[gap->ga_len++] =
! read_cnt_string(fd, 1, &cnt);
// <comppatlen> <comppattext>
if (cnt < 0)
return cnt;
*** ../vim-8.2.3327/src/version.c 2021-08-11 14:20:01.863195717 +0200
--- src/version.c 2021-08-11 15:54:02.387851005 +0200
***************
*** 757,758 ****
--- 757,760 ----
{ /* Add new patch number below this line */
+ /**/
+ 3328,
/**/
--
[SIR LAUNCELOT runs back up the stairs, grabs a rope
of the wall and swings out over the heads of the CROWD in a
swashbuckling manner towards a large window. He stops just short
of the window and is left swing pathetically back and forth.]
LAUNCELOT: Excuse me ... could somebody give me a push ...
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202108111355.17BDtREc2927891%40masaka.moolenaar.net.