shithub: choc

Download patch

ref: 82132ad618b5c6de247568a3a026367799ff3d96
parent: 15cec0d05f33ad4696ada2f73bea309f30f273b2
parent: 0b27583c5cdfecd020cdaf7dcce140e186c3b4ff
author: Simon Howard <[email protected]>
date: Wed Jul 22 06:07:50 EDT 2015

Merge pull request #588 from jmtd/text-segv

Add constraint check to CellOverflowedSize

--- a/textscreen/txt_table.c
+++ b/textscreen/txt_table.c
@@ -99,7 +99,14 @@
         // Every overflow cell must point to either (x, y) or another
         // overflow cell. This means the first in every row must be
         // txt_table_overflow_down.
+
+        if (y1 * table->columns + x >= table->num_widgets)
+        {
+            break;
+        }
+
         widget = table->widgets[y1 * table->columns + x];
+
         if (y1 != y && widget != &txt_table_overflow_down)
         {
             break;