To: vim-dev@vim.org Subject: Patch 6.1.176 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.176 Problem: When the stack limit is very big a false out-of-stack error may be detected. Solution: Add a check for overflow of the stack limit computation. (Jim Dunleavy) Files: src/os_unix.c *** ../vim61.175/src/os_unix.c Sun Jul 21 21:35:45 2002 --- src/os_unix.c Thu Sep 12 21:55:20 2002 *************** *** 609,617 **** --- 609,626 ---- ) { if (stack_grows_downwards) + { stack_limit = (char *)((long)&i - ((long)rlp.rlim_cur / 16L * 15L)); + if (stack_limit >= (char *)&i) + /* overflow, set to 1/16 of current stack position */ + stack_limit = (char *)((long)&i / 16L); + } else + { stack_limit = (char *)((long)&i + ((long)rlp.rlim_cur / 16L * 15L)); + if (stack_limit <= (char *)&i) + stack_limit = NULL; /* overflow */ + } } } *** ../vim61.175/src/version.c Sat Sep 14 16:56:33 2002 --- src/version.c Sat Sep 14 16:58:12 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 176, /**/ -- LARGE MAN: Who's that then? CART DRIVER: (Grudgingly) I dunno, Must be a king. LARGE MAN: Why? CART DRIVER: He hasn't got shit all over him. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///