Visitar URL original
Return allocation error in deserialize instead of panicking by epilys · Pull Request #238 · servo/rust-smallvec · GitHub
Skip to content

Return allocation error in deserialize instead of panicking - #238

Merged
bors-servo merged 1 commit into
servo:masterfrom
epilys:master
Nov 9, 2020
Merged

bors-servo merged 1 commit into
servo:masterfrom
epilys:master

Conversation

@epilys

@epilys epilys commented Nov 8, 2020

Copy link
Copy Markdown
Contributor

There's no way to catch allocation errors since out of memory errors
cause an abort. Fail gracefully by returning the error instead of
panicking.

I happened upon this error when deserializing untrusted data with bincode. Bincode provides a byte limit bound but for sequences it's not possible to enforce this through serde since collection types like smallvec handle their own allocation.

There's no way to catch allocation errors since out of memory errors
cause an abort. Fail gracefully by returning the error instead of
panicking.
@mbrubeck

mbrubeck commented Nov 8, 2020

Copy link
Copy Markdown
Collaborator

@bors-servo r+

Thanks!

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit d1394a0 has been approved by mbrubeck

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit d1394a0 with merge c7af9e2...

@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - checks-travis
Approved by: mbrubeck
Pushing c7af9e2 to master...

@bors-servo
bors-servo merged commit c7af9e2 into servo:master Nov 9, 2020
mbrubeck added a commit to mbrubeck/rust-smallvec that referenced this pull request Nov 16, 2020
Change log:

* Add the `append` method (servo#237).
* Add support for more array sizes between 17 and 31 (servo#234).
* Don't panic on deserialization errors (servo#238).
@mbrubeck mbrubeck mentioned this pull request Nov 16, 2020
bors-servo added a commit that referenced this pull request Nov 17, 2020
Version 1.5.0

Change log:

* Add the `append` method (#237).
* Add support for more array sizes between 17 and 31 (#234).
* Don't panic on deserialization errors (#238).
epilys added a commit to meli/meli that referenced this pull request Nov 22, 2020
Fixes panicking when loading cached serialized email from older versions
of meli.

servo/rust-smallvec#238
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.

3 participants