Problem: Might still access invalid memory.
Solution: Add extra check for negative value.
int n;
int room;
+ // If something unexpected happened "room" may be negative, check for that
+ // just in case.
room = (int)(Rows - cmdline_row - 1) * Columns + sc_col - 1;
- if ((force || (shortmess(SHM_TRUNC) && !exmode_active))
+ if (room > 0 && (force || (shortmess(SHM_TRUNC) && !exmode_active))
&& (n = (int)STRLEN(s) - room) > 0)
{
if (has_mbyte)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 5161,
/**/
5160,
/**/