diff options
author | Dan McGee <dan@archlinux.org> | 2007-11-14 22:51:16 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-11-14 22:51:16 -0600 |
commit | f75ee7176235f2c1a531113985d715ddcafb6d05 (patch) | |
tree | 0b43fc0659f6049dddd65624239fb3a0b30cab4c /lib/libalpm/package.c | |
parent | c244cfecf654d34032585530f00d68501ec63d77 (diff) | |
download | pacman-f75ee7176235f2c1a531113985d715ddcafb6d05.tar.xz |
Fix alpm_list_copy_data
So I spent a good 4 hours tracking a bug down tonight due to
alpm_list_copy_data not actually doing what I expected to do. We can't find
the size of an object we don't know the type of, so rewrite it so we pass
in the size explicitly. This was making _alpm_pkg_dup fail and causing all
sorts of other issues.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/package.c')
-rw-r--r-- | lib/libalpm/package.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 2c6fc29c..d9927668 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -675,12 +675,14 @@ pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg) newpkg->conflicts = alpm_list_strdup(alpm_pkg_get_conflicts(pkg)); newpkg->files = alpm_list_strdup(alpm_pkg_get_files(pkg)); newpkg->backup = alpm_list_strdup(alpm_pkg_get_backup(pkg)); - newpkg->depends = alpm_list_copy_data(alpm_pkg_get_depends(pkg)); + newpkg->depends = alpm_list_copy_data(alpm_pkg_get_depends(pkg), + sizeof(pmdepend_t)); newpkg->optdepends = alpm_list_strdup(alpm_pkg_get_optdepends(pkg)); newpkg->groups = alpm_list_strdup(alpm_pkg_get_groups(pkg)); newpkg->provides = alpm_list_strdup(alpm_pkg_get_provides(pkg)); newpkg->replaces = alpm_list_strdup(alpm_pkg_get_replaces(pkg)); - newpkg->deltas = alpm_list_copy_data(alpm_pkg_get_deltas(pkg)); + newpkg->deltas = alpm_list_copy_data(alpm_pkg_get_deltas(pkg), + sizeof(pmdelta_t)); /* internal */ if(newpkg->origin == PKG_FROM_FILE) { newpkg->origin_data.file = strdup(pkg->origin_data.file); |