From 5c2c79eafdaffd172c20dd2cebc96f3dea266b96 Mon Sep 17 00:00:00 2001 From: kientzle Date: Tue, 13 Apr 2004 23:45:37 +0000 Subject: * Plug a buffer overrun in ACL parsing. (archive_entry.c) * Re-use a single buffer for shar output formatting rather than hammering the heap. (archive_write_set_format_shar.c) * Fix a handful of minor memory leaks and clean up some of the memory-management code. --- lib/libarchive/archive_entry.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/libarchive/archive_entry.c') diff --git a/lib/libarchive/archive_entry.c b/lib/libarchive/archive_entry.c index be261f5..7ea63fc 100644 --- a/lib/libarchive/archive_entry.c +++ b/lib/libarchive/archive_entry.c @@ -481,6 +481,12 @@ archive_entry_set_hardlink(struct archive_entry *entry, const char *target) } void +archive_entry_copy_hardlink(struct archive_entry *entry, const char *target) +{ + aes_copy_mbs(&entry->ae_hardlink, target); +} + +void archive_entry_copy_hardlink_w(struct archive_entry *entry, const wchar_t *target) { aes_copy_wcs(&entry->ae_hardlink, target); @@ -1111,6 +1117,7 @@ __archive_entry_acl_parse_w(struct archive_entry *entry, malloc(namebuff_length * sizeof(wchar_t)); } wmemcpy(namebuff, name_start, name_end - name_start); + namebuff[name_end - name_start] = L'\0'; archive_entry_acl_add_entry_w(entry, type, permset, tag, id, namebuff); } -- cgit v1.1