Skip to content

Conversation

DennisHeimbigner
Copy link
Collaborator

@DennisHeimbigner DennisHeimbigner commented Aug 8, 2023

A corrupted classic file is causing the library to crash. Fix so that it returns NC_ENOTNC instead.

re: Issue Unidata#2731

A corrupted classic file is causing the library to crash.
Fix so that it returns NC_ENOTNC instead.
libsrc/posixio.c Outdated
assert(extent != 0);
assert(extent < X_INT_MAX); /* sanity check */
assert(offset >= 0); /* sanity check */
if(extent == 0 || extent >= X_INT_MAX || offset >= 0) /* sanity check */
Copy link
Contributor

Choose a reason for hiding this comment

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

Drive-by-review:

It should be offset < 0 right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Correct; just pushed a fix.

@WardF WardF merged commit c374536 into Unidata:main Aug 9, 2023
@DennisHeimbigner DennisHeimbigner deleted the corrupt.dmh branch September 27, 2023 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nc_open "Abort" crash on a corrupted netCDF classic file
3 participants