From 85d28994b93ee020dae26193e81aacf4be90b3ea Mon Sep 17 00:00:00 2001 From: jbj Date: Sun, 31 Oct 2004 20:22:01 +0000 Subject: [PATCH] - python: remove ".A" from creaky ts.check() tuple return (#135008). - python: fix RPMPROB_BADRELOCATE segfault return in ts.check (#137116). - revert selinux patch until fc3 release. - reprise file conflicts yet again, flip/flop/flip/flop ... - fix: buffer overrun displaying ko_KR (#135389). CVS patchset: 7532 CVS date: 2004/10/31 20:22:01 --- CHANGES | 5 +++++ lib/formats.c | 23 ++++++++++++++++++----- neon/src/.splintrc | 2 +- neon/src/ne_xml.h | 2 +- python/rpmts-py.c | 4 ++++ 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index c67a625..a9b53fa 100644 --- a/CHANGES +++ b/CHANGES @@ -57,6 +57,11 @@ - selinux: set "rpm_script_t" always, not just for /bin/sh. - honor inherited SIG_IGN when establishing rpmdb signal exit (#134474). - don't add time stamp to compressed man pages (#132526). + - python: remove ".A" from creaky ts.check() tuple return (#135008). + - python: fix RPMPROB_BADRELOCATE segfault return in ts.check (#137116). + - revert selinux patch until fc3 release. + - reprise file conflicts yet again, flip/flop/flip/flop ... + - fix: buffer overrun displaying ko_KR (#135389). 4.3 -> 4.3.1: - fix: don't add leading space to %* argv expansion (#119059). diff --git a/lib/formats.c b/lib/formats.c index c5e42f0..ebfc1db 100644 --- a/lib/formats.c +++ b/lib/formats.c @@ -432,11 +432,15 @@ static /*@only@*/ char * pgpsigFormat(int_32 type, const void * data, } else { pgpDig dig = pgpNewDig(); pgpDigParams sigp = &dig->signature; - size_t nb = 80; + size_t nb = 0; + const char *tempstr; (void) pgpPrtPkts(pkt, pktlen, dig, 0); - val = t = xmalloc(nb + 1); + val = NULL; + again: + nb += 100; + val = t = xrealloc(val, nb + 1); /*@-boundswrite@*/ switch (sigp->pubkey_algo) { @@ -447,10 +451,12 @@ static /*@only@*/ char * pgpsigFormat(int_32 type, const void * data, t = stpcpy(t, "RSA"); break; default: - sprintf(t, "%d", sigp->pubkey_algo); + snprintf(t, nb - (t - val), "%d", sigp->pubkey_algo); t += strlen(t); break; } + if (t + 5 >= val + nb) + goto again; *t++ = '/'; switch (sigp->hash_algo) { case PGPHASHALGO_MD5: @@ -460,10 +466,12 @@ static /*@only@*/ char * pgpsigFormat(int_32 type, const void * data, t = stpcpy(t, "SHA1"); break; default: - sprintf(t, "%d", sigp->hash_algo); + snprintf(t, nb - (t - val), "%d", sigp->hash_algo); t += strlen(t); break; } + if (t + strlen (", ") + 1 >= val + nb) + goto again; t = stpcpy(t, ", "); @@ -474,8 +482,13 @@ static /*@only@*/ char * pgpsigFormat(int_32 type, const void * data, (void) strftime(t, (nb - (t - val)), "%c", tstruct); } t += strlen(t); + if (t + strlen (", Key ID ") + 1 >= val + nb) + goto again; t = stpcpy(t, ", Key ID "); - t = stpcpy(t, pgpHexStr(sigp->signid, sizeof(sigp->signid))); + tempstr = pgpHexStr(sigp->signid, sizeof(sigp->signid)); + if (t + strlen (tempstr) > val + nb) + goto again; + t = stpcpy(t, tempstr); /*@=boundswrite@*/ dig = pgpFreeDig(dig); diff --git a/neon/src/.splintrc b/neon/src/.splintrc index 6e37a16..89328bd 100644 --- a/neon/src/.splintrc +++ b/neon/src/.splintrc @@ -1,4 +1,4 @@ --I. -I.. -I../../expat -I../../zlib -DHAVE_CONFIG_H -D_LARGFILE_SOURCE +-I. -I.. -I../../expat/lib -I../../zlib -DHAVE_CONFIG_H -D_LARGFILE_SOURCE +partial +forcehints diff --git a/neon/src/ne_xml.h b/neon/src/ne_xml.h index 8542688..59136f7 100644 --- a/neon/src/ne_xml.h +++ b/neon/src/ne_xml.h @@ -128,7 +128,7 @@ int ne_xml_parse_v(void *userdata, const char *block, size_t len) /* Return current parse line for errors */ int ne_xml_currentline(ne_xml_parser *p) - /*@*/; + /*@modifies p @*/; /* From a start_element callback which was passed 'attrs' using given * parser, return attribute of given name and namespace. If nspace is diff --git a/python/rpmts-py.c b/python/rpmts-py.c index 4a18fbb..102a1cb 100644 --- a/python/rpmts-py.c +++ b/python/rpmts-py.c @@ -420,6 +420,10 @@ fprintf(stderr, "*** rpmts_Check(%p) ts %p cb %p\n", s, s->ts, cbInfo.cb); p = ps->probs + i; + /* XXX autorelocated i386 on ia64, fix system-config-packages! */ + if (p->type == RPMPROB_BADRELOCATE) + continue; + byName = p->pkgNEVR; if ((byArch= strrchr(byName, '.')) != NULL) *byArch++ = '\0'; -- 2.7.4