diff --git a/VERSION b/VERSION index 74430e76..7b6e37ae 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.262 +8.3.263 diff --git a/commands/CmdAB.c b/commands/CmdAB.c index c753aab2..7436f56f 100644 --- a/commands/CmdAB.c +++ b/commands/CmdAB.c @@ -615,7 +615,7 @@ CmdBox(w, cmd) }; CellDef *rootBoxDef; - Rect rootBox, editbox, *boxptr; + Rect rootBox, editbox, savebox, *boxptr; Point ll; int option, direction, distancex, distancey; int width, height; @@ -756,6 +756,7 @@ CmdBox(w, cmd) /*----------------------------------------------------------*/ boxptr = (refEdit) ? &editbox : &rootBox; + savebox = *boxptr; /*----------------------------------------------------------*/ /* Parse arguments according to class */ @@ -1167,6 +1168,18 @@ badusage: if (refEdit) GeoTransRect(&EditToRootTransform, &editbox, &rootBox); + /*----------------------------------------------------------*/ + /* Check for numerical overflow in box values */ + /*----------------------------------------------------------*/ + + if (boxptr->r_ll.p_x < (MINFINITY + 2) || boxptr->r_ll.p_x > (INFINITY - 2) || + boxptr->r_ll.p_y < (MINFINITY + 2) || boxptr->r_ll.p_y > (INFINITY - 2)) + { + *boxptr = savebox; + TxError("Box out of bounds.\n"); + return; + } + /*----------------------------------------------------------*/ /* Change the position of the box in the layout window */ /*----------------------------------------------------------*/