Merge pull request #1008 from ethcore/uint-deserialization
Fixed uint deserialization from hex
This commit is contained in:
commit
c2787d80c8
@ -797,7 +797,7 @@ macro_rules! construct_uint {
|
||||
|
||||
fn visit_str<E>(&mut self, value: &str) -> Result<Self::Value, E> where E: serde::Error {
|
||||
// 0x + len
|
||||
if value.len() > 2 + $n_words * 16 {
|
||||
if value.len() > 2 + $n_words * 16 || value.len() < 2 {
|
||||
return Err(serde::Error::custom("Invalid length."));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user