From: Alain Spineux Date: Mon, 20 Apr 2020 14:45:14 +0000 (+0200) Subject: BEE Backport bacula/src/findlib/win32filter.h X-Git-Tag: Release-11.3.2~1826 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e244df4551807b06ca4f5371b9fc49d58f72fcf;p=thirdparty%2Fbacula.git BEE Backport bacula/src/findlib/win32filter.h This commit is the result of the squash of the following main commits: Author: Alain Spineux Date: Mon Jul 9 14:02:24 2018 +0200 win32: make Win32Filter handle corrupted data - if data looks corrupted, then Win32Filter::have_data() skip the data up to the end of the input stream. - the error flag is set when the sizes in the header are <0 Author: Eric Bollengier Date: Thu Nov 5 16:25:37 2015 +0100 Add win32filter class --- diff --git a/bacula/src/findlib/win32filter.h b/bacula/src/findlib/win32filter.h index dd098e3921..801a728eb4 100644 --- a/bacula/src/findlib/win32filter.h +++ b/bacula/src/findlib/win32filter.h @@ -25,7 +25,7 @@ #include "bacula.h" /* this should physically correspond to WIN32_STREAM_ID - * from winbase.h on Win32. We didn't inlcude cStreamName + * from winbase.h on Win32. We didn't include cStreamName * as we don't use it and don't need it for a correct struct size. */ @@ -41,6 +41,7 @@ typedef struct _BWIN32_STREAM_ID { class Win32Filter { public: + bool error; /* set when an error is detected */ bool initialized; int64_t skip_size; /* how many bytes we have to skip before next header */ int64_t data_size; /* how many data are expected in the stream */ @@ -53,6 +54,7 @@ public: }; void init() { + error = false; initialized = false; skip_size = 0; data_size = 0;