#define O_CLOEXEC 0
#endif
+#define MAX_FILESYSTEM_ID 1000000
+
#if defined(__hpux) && !defined(HAVE_DIRFD)
#define dirfd(x) ((x)->__dd_fd)
#define HAVE_DIRFD
* This is the new filesystem which we have to generate a new ID for.
*/
fid = t->max_filesystem_id++;
+ if (fid > MAX_FILESYSTEM_ID) {
+ archive_set_error(&a->archive, ENOMEM, "Too many filesystems");
+ return (ARCHIVE_FATAL);
+ }
if (t->max_filesystem_id > t->allocated_filesystem) {
int s;
void *p;
/* To deal with absolute symlink issues */
#define START_ABSOLUTE_SYMLINK_REPARSE L"\\??\\"
+#define MAX_FILESYSTEM_ID 1000000
+
/*-
* This is a new directory-walking system that addresses a number
* of problems I've had with fts(3). In particular, it has no
* There is a new filesystem, we generate a new ID for.
*/
fid = t->max_filesystem_id++;
+ if (fid > MAX_FILESYSTEM_ID) {
+ archive_set_error(&a->archive, ENOMEM, "Too many filesystems");
+ return (ARCHIVE_FATAL);
+ }
if (t->max_filesystem_id > t->allocated_filesystem) {
- size_t s;
+ int s;
void *p;
s = t->max_filesystem_id * 2;