diff options
author | jbj <devnull@localhost> | 2004-10-31 20:22:01 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2004-10-31 20:22:01 +0000 |
commit | 85d28994b93ee020dae26193e81aacf4be90b3ea (patch) | |
tree | a73ded9368a732eabfa07915910fe453847fd912 /lib | |
parent | 4ba9d376d97595752e19b1310f1eded58e414b38 (diff) | |
download | librpm-tizen-85d28994b93ee020dae26193e81aacf4be90b3ea.tar.gz librpm-tizen-85d28994b93ee020dae26193e81aacf4be90b3ea.tar.bz2 librpm-tizen-85d28994b93ee020dae26193e81aacf4be90b3ea.zip |
- 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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/formats.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/formats.c b/lib/formats.c index c5e42f048..ebfc1db24 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); |