[packages/rpm] - properly null-terminate ascii digest string, this fixes upgrade problems with packages built wit

baggins baggins at pld-linux.org
Tue Oct 2 22:56:24 CEST 2012


commit 1fcc9b697ab46dea8df3be15bf8ae969ec50c9f0
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Tue Oct 2 22:55:04 2012 +0200

    - properly null-terminate ascii digest string, this fixes upgrade
      problems with packages built with rpm5 on old rpm-4.5
    - rel 16

 rpm-null-term-ascii-digest.patch | 19 +++++++++++++++++++
 rpm.spec                         |  4 +++-
 2 files changed, 22 insertions(+), 1 deletion(-)
---
diff --git a/rpm.spec b/rpm.spec
index d0395ca..77b19eb 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -52,7 +52,7 @@ Summary(ru.UTF-8):	Менеджер пакетов от RPM
 Summary(uk.UTF-8):	Менеджер пакетів від RPM
 Name:		rpm
 Version:	5.4.10
-Release:	15
+Release:	16
 License:	LGPL
 Group:		Base
 # http://rpm5.org/files/rpm/rpm-5.4/rpm-5.4.10-0.20120706.src.rpm
@@ -140,6 +140,7 @@ Patch48:	%{name}-verify-ghosts-broken-logic.patch
 Patch49:	%{name}-python-enable-compat-RPMSENSE.patch
 Patch50:	%{name}-dont-treat-gstreamer-modules-as-font.patch
 Patch51:	%{name}-gst-inspect-typo.patch
+Patch52:	%{name}-null-term-ascii-digest.patch
 
 # Patches imported from Mandriva
 
@@ -817,6 +818,7 @@ Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze
 %patch49 -p1
 %patch50 -p1
 %patch51 -p1
+%patch52 -p0
 
 %patch1000 -p1
 %patch1001 -p1
diff --git a/rpm-null-term-ascii-digest.patch b/rpm-null-term-ascii-digest.patch
new file mode 100644
index 0000000..06102d7
--- /dev/null
+++ b/rpm-null-term-ascii-digest.patch
@@ -0,0 +1,19 @@
+Index: rpmdb/legacy.c
+===================================================================
+RCS file: /v/rpm/cvs/rpm/rpmdb/legacy.c,v
+retrieving revision 1.44.4.3
+diff -p -u -w -r1.44.4.3 legacy.c
+--- rpmdb/legacy.c	16 Apr 2012 23:43:34 -0000	1.44.4.3
++++ rpmdb/legacy.c	2 Oct 2012 20:17:21 -0000
+@@ -282,8 +282,10 @@ int dodigest(int dalgo, const char * fn,
+ exit:
+     if (fsizep)
+ 	*fsizep = fsize;
+-    if (!rc)
++    if (!rc) {
+ 	memcpy(digest, dsum, dlen);
++	if (asAscii) digest[dlen] = '\0';
++    }
+     dsum = _free(dsum);
+ 
+     return rc;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm.git/commitdiff/1fcc9b697ab46dea8df3be15bf8ae969ec50c9f0



More information about the pld-cvs-commit mailing list