OBS User unknown 2007-02-19 22:44:52 +00:00 committed by Git OBS Bridge
parent 98eb5a6068
commit 3824d15c1b
3 changed files with 103 additions and 4 deletions

90
texinfo-4.8-xml.patch Normal file
View File

@ -0,0 +1,90 @@
--- makeinfo/xml.c
+++ makeinfo/xml.c 2007-02-19 14:53:37.000000000 +0100
@@ -30,6 +30,8 @@
#include "xml.h"
+#include <assert.h>
+
/* Options */
int xml_index_divisions = 1;
@@ -657,6 +659,7 @@ static int element_stack_index = 0;
static int
xml_current_element (void)
{
+ assert (element_stack_index > 0);
return element_stack[element_stack_index-1];
}
@@ -675,9 +678,10 @@ xml_pop_current_element (void)
{
element_stack_index--;
if (element_stack_index < 0)
- printf ("*** stack underflow (%d - %d) ***\n",
- element_stack_index,
- xml_current_element());
+ {
+ printf ("*** stack underflow (index %d) ***\n", element_stack_index);
+ element_stack_index = 0;
+ }
}
int
@@ -712,7 +716,8 @@ xml_start_para (void)
|| !xml_element_list[xml_current_element()].contains_para)
return;
- while (output_paragraph[output_paragraph_offset-1] == '\n')
+ while (output_paragraph_offset > 0
+ && output_paragraph[output_paragraph_offset-1] == '\n')
output_paragraph_offset--;
xml_indent ();
@@ -730,7 +735,8 @@ xml_end_para (void)
if (!xml_in_para || xml_in_footnote)
return;
- while (cr_or_whitespace(output_paragraph[output_paragraph_offset-1]))
+ while (output_paragraph_offset > 0
+ && cr_or_whitespace(output_paragraph[output_paragraph_offset-1]))
output_paragraph_offset--;
insert_string ("</para>");
@@ -789,7 +795,7 @@ xml_insert_element_with_attribute (elt,
/* Look at the replace_elements table to see if we have to change the element */
if (xml_sort_index)
return;
- if (docbook)
+ if (docbook && element_stack_index > 0)
{
replace_element *element_list = replace_elements;
while (element_list->element_to_replace >= 0)
@@ -905,13 +911,15 @@ xml_insert_element_with_attribute (elt,
/* Eat one newline before </example> and the like. */
if (!docbook && arg == END
&& (xml_element_list[elt].keep_space || elt == GROUP)
+ && output_paragraph_offset > 0
&& output_paragraph[output_paragraph_offset-1] == '\n')
output_paragraph_offset--;
/* And eat whitespace before </entry> in @multitables. */
if (arg == END && elt == ENTRY)
- while (cr_or_whitespace(output_paragraph[output_paragraph_offset-1]))
- output_paragraph_offset--;
+ while (output_paragraph_offset > 0 &&
+ cr_or_whitespace(output_paragraph[output_paragraph_offset-1]))
+ output_paragraph_offset--;
/* Indent elements that can contain <para>. */
if (arg == END && !xml_in_para && !xml_keep_space
@@ -1214,7 +1222,8 @@ xml_add_char (int character)
xml_just_after_element = 0;
}
- if (xml_element_list[xml_current_element()].contains_para
+ if (element_stack_index > 0
+ && xml_element_list[xml_current_element()].contains_para
&& !xml_in_para && !only_macro_expansion && !xml_no_para
&& !cr_or_whitespace (character) && !in_fixed_width_font)
xml_start_para ();

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Feb 19 15:01:24 CET 2007 - werner@suse.de
- Avoid array subscript below array bounds (bug #246740)
-------------------------------------------------------------------
Fri Nov 10 14:07:28 CET 2006 - werner@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package texinfo (Version 4.8)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
@ -12,11 +12,11 @@
Name: texinfo
BuildRequires: libzio
License: GNU General Public License (GPL) - all versions, Other License(s), see package
License: GNU General Public License (GPL)
Group: Productivity/Publishing/Texinfo
Autoreqprov: on
Version: 4.8
Release: 39
Release: 50
Summary: Tools Needed to Create Documentation from Texinfo Sources
URL: http://www.texinfo.org
PreReq: %{install_info_prereq}
@ -34,6 +34,7 @@ Patch5: texinfo-%{version}-tempfile.patch
Patch6: texinfo-%{version}-echo.patch
Patch7: texi2roff-2.0-gcc4.patch
Patch8: texinfo-4.8-sec.patch
Patch9: texinfo-4.8-xml.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -99,6 +100,7 @@ rm -rf texi2html-1.76 texi2roff-2.0
%patch5 -p0 -b .tempfile
%patch6 -p0 -b .echo
%patch8 -p0 -b .sec
%patch9 -p0 -b .xml
# nb is already there and more recent
rm -fv po/no.*
cd ../texi2html-1.76
@ -214,7 +216,9 @@ test -n "$RPM_BUILD_ROOT" && rm -rf ${RPM_BUILD_ROOT}
%{_mandir}/man1/install-info.1*
%{_mandir}/man5/info.5*
%changelog -n texinfo
%changelog
* Mon Feb 19 2007 - werner@suse.de
- Avoid array subscript below array bounds (bug #246740)
* Fri Nov 10 2006 - werner@suse.de
- Fix buffer overflow in texi2dvi (bug #214920)
* Mon Jul 24 2006 - adrian@suse.de