This commit is the result of the squash of the following main commits:
Author: Alain Spineux <alain@baculasystems.com>
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 <eric@baculasystems.com>
Date: Thu Nov 5 16:25:37 2015 +0100
Add win32filter class
#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.
*/
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 */
};
void init() {
+ error = false;
initialized = false;
skip_size = 0;
data_size = 0;