Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various checks to improve handling of damaged input files #643

Merged

Conversation

peterhillman
Copy link
Contributor

  • Prevent out-of-bounds reads by better sanity checking of input data
  • Fix memory leaks when exceptions are thrown from constructors when opening broken files
  • Fix memory leaks in test suite

…mum dimensions of data windows

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
…ne error on max suffix string length

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
…ubles to prevent rounding causing overflows

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
…table wasn't deleted

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 23, 2020

CLA Check
The committers are authorized under a signed CLA.

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
@@ -288,6 +288,7 @@ DeepTiledInputFile::Data::Data (int numThreads):
multiPartBackwardSupport(false),
numThreads(numThreads),
memoryMapped(false),
sampleCountTableComp(NULL),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NULLs are expected to be nullptr these days....

@@ -1052,7 +1052,10 @@ hufUncompress (const char compressed[],
unsigned short raw[],
int nRaw)
{
if (nCompressed == 0)
//
// nead at least 20 bytes for header
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo "need"

@@ -745,7 +745,10 @@ TiledInputFile::TiledInputFile (const char fileName[], int numThreads):

delete _data->_streamData;
}

if (_data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these null checks aren't necessary, and there's a few in a row that check != 0 or the pointer. Be better to just squash them all to delete....

Copy link
Contributor

@meshula meshula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything checks out, there's a few super minor things, noted in local comments.

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Copy link
Contributor

@meshula meshula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes!

@peterhillman peterhillman merged commit 89ce46f into AcademySoftwareFoundation:master Feb 4, 2020
@peterhillman peterhillman deleted the securityfixes branch February 4, 2020 02:10
@cary-ilm cary-ilm added this to the v2.5.0 milestone Apr 26, 2020
peterhillman referenced this pull request May 9, 2020
* fix leak when maximum number of tiles is exceeded
* fix leak in InputPart constructor logic

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants