-
-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CString compatibility with bincode v1 (#502)
- Loading branch information
Showing
5 changed files
with
27 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,6 @@ mod issue_459; | |
|
||
#[path = "issues/issue_474.rs"] | ||
mod issue_474; | ||
|
||
#[path = "issues/issue_498.rs"] | ||
mod issue_498; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#![cfg(feature = "std")] | ||
|
||
extern crate std; | ||
|
||
use std::ffi::CString; | ||
|
||
#[test] | ||
fn test_issue_498() { | ||
let bytes = [1, 0, 0, 0, 0, 0, 0, 0, 0]; | ||
let out: Result<(CString, _), _> = | ||
bincode::decode_from_slice(&bytes, bincode::config::legacy().with_limit::<1024>()); | ||
|
||
match out.unwrap_err() { | ||
bincode::error::DecodeError::CStringNulError { inner: _ } => {} | ||
err => panic!("Expected CStringNullErr, found {:?}", err), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters