summaryrefslogtreecommitdiff
path: root/lib/header.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-06-12 11:04:33 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-06-12 11:05:47 +0300
commitebcdb5c57a1e1d570c53927901e45d5c8f8c178d (patch)
treeeb3cc2d744a163065d82c4de3a3ccb7d4d0f6b7b /lib/header.c
parent7705737c4731f9b7164c91b150e2a94053bd07ff (diff)
downloadrpm-ebcdb5c57a1e1d570c53927901e45d5c8f8c178d.tar.gz
rpm-ebcdb5c57a1e1d570c53927901e45d5c8f8c178d.tar.bz2
rpm-ebcdb5c57a1e1d570c53927901e45d5c8f8c178d.zip
Dumb thinko in header data allocation
Diffstat (limited to 'lib/header.c')
-rw-r--r--lib/header.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/header.c b/lib/header.c
index d7e8f74f1..c73e25af9 100644
--- a/lib/header.c
+++ b/lib/header.c
@@ -1235,9 +1235,8 @@ static int copyTdEntry(const indexEntry entry, rpmtd td, headerGetFlags flags)
case RPM_INT32_TYPE:
case RPM_INT64_TYPE:
if (allocMem) {
- size_t dlen = entry->length * typeSizes[entry->info.type];
- td->data = xmalloc(dlen);
- memcpy(td->data, entry->data, dlen);
+ td->data = xmalloc(entry->length);
+ memcpy(td->data, entry->data, entry->length);
} else {
td->data = entry->data;
}