- macro arg handling tweaks to fix #455307

This commit is contained in:
Panu Matilainen 2008-07-15 17:18:17 +00:00
parent 7c8e00941a
commit 469c1cfe44
2 changed files with 24 additions and 1 deletions

17
rpm-4.5.90-macroarg.patch Normal file
View File

@ -0,0 +1,17 @@
diff --git a/rpmio/macro.c b/rpmio/macro.c
index 14d4565..cc0638a 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -797,8 +797,10 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se,
{ ARGV_t av = NULL;
char *s = xcalloc((lastc-se)+1, sizeof(*s));
- memmove(s, se, (lastc-se));
- ret = se + strlen(s) + 1;
+ /* XXX expandMacro() expects next \0 which can be beyond lastc */
+ ret = strchr(se, '\0');
+ memcpy(s, se, (lastc-se));
+
argvSplit(&av, s, " ");
argvAppend(&argv, av);

View File

@ -18,7 +18,7 @@
Summary: The RPM package management system
Name: rpm
Version: %{rpmver}
Release: 0.%{snapver}.7
Release: 0.%{snapver}.8
Group: System Environment/Base
Url: http://www.rpm.org/
Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
@ -34,6 +34,7 @@ Patch100: rpm-4.6.x-no-pkgconfig-reqs.patch
# These are already upstream, drop on next snapshot update:
Patch200: rpm-4.5.90-digestlen.patch
Patch201: rpm-4.5.90-mono-magic.patch
Patch202: rpm-4.5.90-macroarg.patch
# Partially GPL/LGPL dual-licensed and some bits with BSD
# SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD
@ -163,6 +164,7 @@ that will manipulate RPM packages and databases.
%patch200 -p1 -b .diglen
%patch201 -p1 -b .mono-magic
%patch202 -p1 -b .macroarg
%if %{with int_bdb}
ln -s db-%{bdbver} db
@ -338,6 +340,10 @@ exit 0
%doc doc/librpm/html/*
%changelog
* Tue Jul 15 2008 Panu Matilainen <pmatilai@redhat.com>
- 4.5.90-0.git8426.8
- fix regression in macro argument handling (#455333)
* Mon Jul 14 2008 Panu Matilainen <pmatilai@redhat.com>
- 4.5.90-0.git8426.7
- fix mono dependency extraction (adjust for libmagic string change)