diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-16 18:26:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-16 18:26:40 +0000 |
commit | 34f1d05ca3b350257f1d9ddb0aba57f129c27c67 (patch) | |
tree | eccee464f1cccec702d6b9a87f1732c343bd74c2 /src/import | |
parent | Adding debian version 256.4-3. (diff) | |
download | systemd-34f1d05ca3b350257f1d9ddb0aba57f129c27c67.tar.xz systemd-34f1d05ca3b350257f1d9ddb0aba57f129c27c67.zip |
Merging upstream version 256.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/import')
-rw-r--r-- | src/import/import-raw.c | 5 | ||||
-rw-r--r-- | src/import/import-tar.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/import/import-raw.c b/src/import/import-raw.c index ee9b297..78775b9 100644 --- a/src/import/import-raw.c +++ b/src/import/import-raw.c @@ -409,6 +409,11 @@ static int raw_import_process(RawImport *i) { goto finish; } + if ((size_t) l > sizeof(i->buffer) - i->buffer_size) { + r = log_error_errno(SYNTHETIC_ERRNO(EBADMSG), "Read input file exceeded maximum size."); + goto finish; + } + i->buffer_size += l; if (i->compress.type == IMPORT_COMPRESS_UNKNOWN) { diff --git a/src/import/import-tar.c b/src/import/import-tar.c index 39df11b..976c918 100644 --- a/src/import/import-tar.c +++ b/src/import/import-tar.c @@ -276,6 +276,11 @@ static int tar_import_process(TarImport *i) { goto finish; } + if ((size_t) l > sizeof(i->buffer) - i->buffer_size) { + r = log_error_errno(SYNTHETIC_ERRNO(EBADMSG), "Read input file exceeded maximum size."); + goto finish; + } + i->buffer_size += l; if (i->compress.type == IMPORT_COMPRESS_UNKNOWN) { |