[rhel6-branch] Prevent anaconda from crashing due to repeated calls to rpmReadConfigFiles. (#1021534)

Samantha N. Bueno sbueno+anaconda at redhat.com
Tue Feb 3 11:10:18 UTC 2015


explodeRPM() in rpmextract.c is calling rpmReadConfigFiles() once per
every package processed without ever calling rpmFreeRpmrc() to free up
the resources, eventually causing anaconda to explode; so, avoid the
issue by only calling rmReadConfigFiles if the rpm has already been
initialized.

Thanks to Panu Matilainen <pmatilai at redhat.com> for the patch.

Resolves: rhbz#1021534
---
 loader/rpmextract.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/loader/rpmextract.c b/loader/rpmextract.c
index 7054c5f..3da8b22 100644
--- a/loader/rpmextract.c
+++ b/loader/rpmextract.c
@@ -122,6 +122,7 @@ int explodeRPM(const char *source,
     rpmts ts;
     rpmVSFlags vsflags;
     const char *compr;
+    static int rpm_initialized = 0;
 
     int packageflags = 0;
 
@@ -135,7 +136,10 @@ int explodeRPM(const char *source,
         logMessage(ERROR, "%s: %s\n", srcname, Fstrerror(fdi));
         return EXIT_FAILURE;
     }
-    rpmReadConfigFiles(NULL, NULL);
+    if (!rpm_initialized) {
+        rpmReadConfigFiles(NULL, NULL);
+        rpm_initialized = 1;
+    }
 
     /* Initialize RPM transaction */
     ts = rpmtsCreate();
-- 
1.9.3



More information about the anaconda-patches mailing list