Patch 8.1.1054
Problem: Not checking return value of ga_grow(). (Coverity)
Solution: Only append when ga_grow() returns OK.
Files: src/if_lua.c
*** ../vim-8.1.1053/src/if_lua.c 2019-03-23 13:56:30.189804811 +0100
--- src/if_lua.c 2019-03-26 21:40:15.851115489 +0100
***************
*** 1144,1152 ****
size_t i, l = 0;
const char *s = lua_tolstring(L, 2, &l);
! ga_grow(&b->bv_ga, l);
! for (i = 0; i < l; ++i)
! ga_append(&b->bv_ga, s[i]);
}
lua_settop(L, 1);
return 1;
--- 1144,1152 ----
size_t i, l = 0;
const char *s = lua_tolstring(L, 2, &l);
! if (ga_grow(&b->bv_ga, l) == OK)
! for (i = 0; i < l; ++i)
! ga_append(&b->bv_ga, s[i]);
}
lua_settop(L, 1);
return 1;
***************
*** 1776,1784 ****
size_t i, l = 0;
const char *s = lua_tolstring(L, 1, &l);
! ga_grow(&b->bv_ga, l);
! for (i = 0; i < l; ++i)
! ga_append(&b->bv_ga, s[i]);
}
}
return 1;
--- 1776,1784 ----
size_t i, l = 0;
const char *s = lua_tolstring(L, 1, &l);
! if (ga_grow(&b->bv_ga, l) == OK)
! for (i = 0; i < l; ++i)
! ga_append(&b->bv_ga, s[i]);
}
}
return 1;
*** ../vim-8.1.1053/src/version.c 2019-03-26 00:31:17.221047734 +0100
--- src/version.c 2019-03-26 21:41:01.734718469 +0100
***************
*** 777,778 ****
--- 777,780 ----
{ /* Add new patch number below this line */
+ /**/
+ 1054,
/**/
--
I'm writing a book. I've got the page numbers done.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ 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].
For more options, visit https://groups.google.com/d/optout.