Skip to content
Snippets Groups Projects
Commit d6511c61 authored by deuce's avatar deuce
Browse files

Fix crash caused by stupid people doing stupid things.

Now when you can't allocate the second GB of RAM to show your billion line
scrollback, will simply not show you the 1GB of scrollback you have amassed.

You still won't be able to see it, but it won't crash anymore.

Reported by Digital Man.
parent 0b41e7f4
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,8 @@ void viewscroll(void)
gettextinfo(&txtinfo);
/* too large for alloca() */
scrollback=(char *)malloc((scrollback_buf==NULL?0:(term.width*2*settings.backlines))+(txtinfo.screenheight*txtinfo.screenwidth*2));
if(scrollback==NULL)
return;
if(cterm->scrollback != NULL)
memcpy(scrollback,cterm->scrollback,term.width*2*settings.backlines);
gettext(1,1,txtinfo.screenwidth,txtinfo.screenheight,scrollback+(cterm->backpos)*cterm->width*2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment