projects
/
platform
/
upstream
/
rpm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6f69c70
)
Don't segfault on a header without RPMTAG_NAME (rhbz#239557).
author
Panu Matilainen
<pmatilai@redhat.com>
Mon, 18 Jun 2007 09:48:07 +0000
(12:48 +0300)
committer
Panu Matilainen
<pmatilai@redhat.com>
Mon, 18 Jun 2007 09:48:07 +0000
(12:48 +0300)
Patch from JBJ.
lib/formats.c
patch
|
blob
|
history
diff --git
a/lib/formats.c
b/lib/formats.c
index
6eebf83
..
59f953a
100644
(file)
--- a/
lib/formats.c
+++ b/
lib/formats.c
@@
-1028,8
+1028,11
@@
static int i18nTag(Header h, int_32 tag, /*@out@*/ rpmTagType * type,
{ const char * tn = tagName(tag);
const char * n;
char * mk;
- (void) headerNVR(h, &n, NULL, NULL);
- mk = alloca(strlen(n) + strlen(tn) + sizeof("()"));
+ size_t nb = sizeof("()");
+ int xx = headerNVR(h, &n, NULL, NULL);
+ if (tn) nb += strlen(tn);
+ if (n) nb += strlen(n);
+ mk = alloca(nb);
sprintf(mk, "%s(%s)", n, tn);
msgkey = mk;
}