From 7f075bf30dbfd56ee65ee3ba67b1d4bcf36134fc Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Tue, 16 Oct 2007 11:10:40 +0000 Subject: [PATCH] - allocate additional working buffers in new_field (#310071) --- ncurses-5.6-20070812-newfield.patch | 12 ++++++++++++ ncurses.spec | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 ncurses-5.6-20070812-newfield.patch diff --git a/ncurses-5.6-20070812-newfield.patch b/ncurses-5.6-20070812-newfield.patch new file mode 100644 index 0000000..8e256b9 --- /dev/null +++ b/ncurses-5.6-20070812-newfield.patch @@ -0,0 +1,12 @@ +diff -up ncurses-5.6/form/fld_def.c.newfield ncurses-5.6/form/fld_def.c +--- ncurses-5.6/form/fld_def.c.newfield 2007-10-12 14:23:46.000000000 +0200 ++++ ncurses-5.6/form/fld_def.c 2007-10-12 14:26:03.000000000 +0200 +@@ -305,7 +305,7 @@ new_field(int rows, int cols, int frow, + + #if USE_WIDEC_SUPPORT + New_Field->working = newpad(1, Buffer_Length(New_Field) + 1); +- New_Field->expanded = (char **)calloc(1 + (unsigned)rows, sizeof(char *)); ++ New_Field->expanded = (char **)calloc(1 + (unsigned)nbuf, sizeof(char *)); + #endif + + if (_nc_Copy_Type(New_Field, &default_field)) diff --git a/ncurses.spec b/ncurses.spec index c6a6566..8272a10 100644 --- a/ncurses.spec +++ b/ncurses.spec @@ -1,7 +1,7 @@ Summary: A terminal handling library Name: ncurses Version: 5.6 -Release: 11.20070812%{?dist} +Release: 12.20070812%{?dist} License: MIT Group: System Environment/Libraries URL: http://invisible-island.net/ncurses/ncurses.html @@ -17,6 +17,7 @@ Patch11: ncurses-5.6-20070120-urxvt.patch Patch12: ncurses-5.6-20070812-comphash.patch Patch13: ncurses-5.6-20070812-pad.patch Patch14: ncurses-5.6-20070812-fieldbuf.patch +Patch15: ncurses-5.6-20070812-newfield.patch BuildRequires: gpm-devel BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -61,6 +62,7 @@ rm -rf tack %patch12 -p1 -b .comphash %patch13 -p1 -b .pad %patch14 -p1 -b .fieldbuf +%patch15 -p1 -b .newfield # this will be in documentation, drop executable bits chmod 644 test/* @@ -190,6 +192,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/terminfo rm -rf ${RPM_BUILD_ROOT} %changelog +* Tue Oct 16 2007 Miroslav Lichvar 5.6-12.20070812 +- allocate additional working buffers in new_field (#310071) + * Wed Oct 10 2007 Miroslav Lichvar 5.6-11.20070812 - don't write beyond field buffer in form driver (#310071)