From ce2ad5848a52c6ea96e8a29fb8eb40e314b25ccf Mon Sep 17 00:00:00 2001 From: jbj Date: Thu, 19 Aug 2004 17:00:15 +0000 Subject: [PATCH] - avoid "can't happen" recursion while retrieving pubkeys. CVS patchset: 7401 CVS date: 2004/08/19 17:00:15 --- CHANGES | 2 ++ lib/package.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGES b/CHANGES index bbbf7ea..3cc008f 100644 --- a/CHANGES +++ b/CHANGES @@ -22,6 +22,8 @@ - xml: instead of 0 markup. - fix: disable fingerprint generation on kernel paths. - add ppc8[25]60 arches. + - fix: evaluate rather than default file_contexts path. (#127501). + - avoid "can't happen" recursion while retrieving pubkeys. 4.3 -> 4.3.1: - fix: don't add leading space to %* argv expansion (#119059). diff --git a/lib/package.c b/lib/package.c index 273b6df..9dd5601 100644 --- a/lib/package.c +++ b/lib/package.c @@ -350,7 +350,9 @@ rpmRC headerCheck(rpmts ts, const void * uh, size_t uc, const char ** msg) rpmRC rc = RPMRC_FAIL; /* assume failure */ int xx; int i; + static int hclvl; + hclvl++; /*@-boundswrite@*/ buf[0] = '\0'; /*@=boundswrite@*/ @@ -489,6 +491,7 @@ exit: buf[sizeof(buf)-1] = '\0'; if (msg) *msg = xstrdup(buf); /*@=boundswrite@*/ + hclvl--; return rc; } @@ -510,6 +513,7 @@ verifyinfo_exit: buf[sizeof(buf)-1] = '\0'; if (msg) *msg = xstrdup(buf); /*@=boundswrite@*/ + hclvl--; return rc; } @@ -627,9 +631,12 @@ verifyinfo_exit: if (msg) *msg = xstrdup(buf); /*@=boundswrite@*/ + /* XXX headerCheck can recurse, free info only at top level. */ + if (hclvl == 1) rpmtsCleanDig(ts); if (info->tag == RPMTAG_SHA1HEADER) sig = _free(sig); + hclvl--; return rc; } -- 2.7.4