diff options
author | Stuart Stock <stuart@int08h.com> | 2018-03-24 10:50:42 -0500 |
---|---|---|
committer | Stuart Stock <stuart@int08h.com> | 2018-03-24 11:29:33 -0500 |
commit | 9656fdab0f702ccd784a2e50eabcf94809bc31b5 (patch) | |
tree | 9f79ee6600afa1737064588c3d1085ba38aba2d0 /src/error.rs | |
parent | abc7f8b603cac103fa714b84a4495e95f974f57f (diff) | |
download | roughenough-9656fdab0f702ccd784a2e50eabcf94809bc31b5.zip |
Check that value offset does not extend pass end of message
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/error.rs b/src/error.rs index 982d15d..4e6ac5b 100644 --- a/src/error.rs +++ b/src/error.rs @@ -25,6 +25,12 @@ pub enum Error { /// The associated byte sequence does not correspond to a valid Roughtime tag. InvalidTag(Box<[u8]>), + /// Invalid number of tags specified + InvalidNumTags(u32), + + /// Tag value length exceeds length of source bytes + InvalidValueLength(Tag, u32), + /// Encoding failed. The associated `std::io::Error` should provide more information. EncodingFailure(std::io::Error), @@ -37,9 +43,6 @@ pub enum Error { /// Offset is outside of valid message range InvalidOffsetValue(u32), - /// Invalid number of tags specified - InvalidNumTags(u32), - /// Could not convert bytes to message because bytes were too short MessageTooShort, |