Fix memory corruption in genmacro. If the string is empty, don't start

screwing with stuff at str[strlen(str)-1].
This commit is contained in:
David Woodhouse 2005-02-14 09:27:35 +00:00
parent 578b2dcc8a
commit c07b972046
2 changed files with 19 additions and 2 deletions

13
yasm-0.4.0-genmacro.patch Normal file
View File

@ -0,0 +1,13 @@
--- yasm-0.4.0/modules/preprocs/nasm/genmacro.c~ 2004-10-31 03:55:54.000000000 +0000
+++ yasm-0.4.0/modules/preprocs/nasm/genmacro.c 2005-02-14 09:21:37.000000000 +0000
@@ -102,8 +102,8 @@
while (*strp == ' ' || *strp == '\t')
strp++;
len = strlen(strp);
- while (strp[len-1] == ' ' || strp[len-1] == '\t' ||
- strp[len-1] == '\n') {
+ while (len && (strp[len-1] == ' ' || strp[len-1] == '\t' ||
+ strp[len-1] == '\n')) {
strp[len-1] = '\0';
len--;
}

View File

@ -1,11 +1,12 @@
Summary: Complete rewrite of the NASM assembler
Name: yasm
Version: 0.4.0
Release: 1
Release: 2
License: BSD
Group: Development/Languages
URL: http://www.tortall.net/projects/yasm/
Source: http://www.tortall.net/projects/yasm/releases/yasm-%{version}.tar.gz
Patch0: yasm-0.4.0-genmacro.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: bison, byacc, xmlto, gettext-devel
@ -36,7 +37,7 @@ Install this package if you need to rebuild applications that use yasm.
%prep
%setup
%patch0 -p1
%build
%configure
@ -82,6 +83,9 @@ Install this package if you need to rebuild applications that use yasm.
%changelog
* Mon Feb 14 2005 David Woodhouse <dwmw2@infradead.org> 0.4.0-2
- Fix corruption in genmacro
* Fri Jan 28 2005 Matthias Saou <http://freshrpms.net/> 0.4.0-1
- Initial RPM release.