aboutsummaryrefslogtreecommitdiff
path: root/binutils/bucomm.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2014-11-06 14:49:10 +0000
committerNick Clifton <nickc@redhat.com>2014-11-06 14:49:10 +0000
commitdd9b91de2149ee81d47f708e7b0bbf57da10ad42 (patch)
tree9abc44b553f584ed318e6747e7f49d1095ea13c6 /binutils/bucomm.h
parent834107255bbefceb445fa733ebc1ea5d9f41ec7f (diff)
downloadgdb-dd9b91de2149ee81d47f708e7b0bbf57da10ad42.zip
gdb-dd9b91de2149ee81d47f708e7b0bbf57da10ad42.tar.gz
gdb-dd9b91de2149ee81d47f708e7b0bbf57da10ad42.tar.bz2
Prevent archive memebers with illegal pathnames from being extracted from an archive.
PR binutils/17552, binutils/17533 * bucomm.c (is_valid_archive_path): New function. Returns false for absolute pathnames and pathnames that include /../. * bucomm.h (is_valid_archive_path): Add prototype. * ar.c (extract_file): Use new function to check for valid pathnames when extracting files from an archive. * objcopy.c (copy_archive): Likewise. * doc/binutils.texi: Update documentation to mention the limitation on pathname of archive members.
Diffstat (limited to 'binutils/bucomm.h')
-rw-r--r--binutils/bucomm.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/binutils/bucomm.h b/binutils/bucomm.h
index a93c378..a71a8fb 100644
--- a/binutils/bucomm.h
+++ b/binutils/bucomm.h
@@ -21,6 +21,8 @@
#ifndef _BUCOMM_H
#define _BUCOMM_H
+/* In bucomm.c. */
+
/* Return the filename in a static buffer. */
const char *bfd_get_archive_filename (const bfd *);
@@ -56,20 +58,22 @@ bfd_vma parse_vma (const char *, const char *);
off_t get_file_size (const char *);
+bfd_boolean is_valid_archive_path (char const *);
+
extern char *program_name;
-/* filemode.c */
+/* In filemode.c. */
void mode_string (unsigned long, char *);
-/* version.c */
+/* In version.c. */
extern void print_version (const char *);
-/* rename.c */
+/* In rename.c. */
extern void set_times (const char *, const struct stat *);
extern int smart_rename (const char *, const char *, int);
-/* libiberty. */
+/* In libiberty. */
void *xmalloc (size_t);
void *xrealloc (void *, size_t);