bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libform lacks a bounds check


From: Thomas Dickey
Subject: Re: libform lacks a bounds check
Date: Sat, 3 Jun 2006 06:30:17 -0400 (EDT)

On Tue, 30 May 2006, john heasley wrote:

libform of ncurses 5.5 has a constraint on the number of fields in a form
at 32767 or that of signed short.  But, Connect_Fields() does not check
it's field count (field_cnt) before sorting and such near the end of the
function.

I changed it like so, on line 185:

   182         page_nr++;
   183       fields[field_cnt]->form = form;
   184     }
   185   if (field_cnt == 0 || (short) field_cnt < -1)
   186     RETURN(E_BAD_ARGUMENT);
   187
   188   /* allocate page structures */

thanks

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]