Skip to content

Validate mpy load #1972

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

Merged
merged 6 commits into from
Jun 27, 2019
Merged

Validate mpy load #1972

merged 6 commits into from
Jun 27, 2019

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Jun 26, 2019

This should help prevent hard crashes when an mpy file is corrupt.

@tannewt tannewt added this to the 4.x.x - Bug fixes milestone Jun 26, 2019
tannewt added 3 commits June 26, 2019 11:02
Rollback HID to save string space and remove board mapping for
default buses that don't exist.
@tannewt tannewt requested a review from dhalbert June 27, 2019 00:39
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Good idea!

return mp_parse_num_decimal(vstr.buf, vstr.len, obj_type == 'c', false, NULL);
}
}
raise_corrupt_mpy();
return MP_OBJ_FROM_PTR(&mp_const_none_obj);
Copy link
Collaborator

Choose a reason for hiding this comment

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

The return value is a size_t, not an mp_obj_t. If the compiler is forcing you to return something, even though it will never get executed, just return 0, I'd say.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Never mind, confused by diff listing with missing lines.

@dhalbert dhalbert merged commit c562b19 into adafruit:4.0.x Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants