summaryrefslogtreecommitdiff
path: root/lib/tar/internal.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-25 23:35:15 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-25 23:35:15 +0200
commitba82a3812d39acf6c865478f72d7e68838c14f69 (patch)
tree4e558c02e997e97b41b1b353cf15f67c660b968c /lib/tar/internal.h
parent935131744634f9a29e5d53a06a411dbb455cb1ae (diff)
Enforce reasonable upper and low bounds on the size of tar headers
Since they are read directly into memory, blindly allocating the size from the tar ball is probably a bad idea. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/tar/internal.h')
-rw-r--r--lib/tar/internal.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/tar/internal.h b/lib/tar/internal.h
index 6ac8d99..d59be14 100644
--- a/lib/tar/internal.h
+++ b/lib/tar/internal.h
@@ -32,6 +32,12 @@ enum {
ETV_POSIX,
};
+
+#define TAR_MAX_SYMLINK_LEN (65536)
+#define TAR_MAX_PATH_LEN (65536)
+#define TAR_MAX_PAX_LEN (65536)
+
+
int read_octal(const char *str, int digits, uint64_t *out);
int read_binary(const char *str, int digits, uint64_t *out);