Create a buffer overflow test.
This tests buffer overflow for the basic types. It does not currently test the platform int and uint until the final function definitions are determined.
This commit is contained in:
@ -36,7 +36,7 @@ macro_rules! read_bytes
|
||||
({
|
||||
use std::$return_type;
|
||||
|
||||
assert!($return_type::BYTES <= $buffer.len());
|
||||
assert!($buffer.len() < $return_type::BYTES);
|
||||
unsafe
|
||||
{
|
||||
(*($buffer.as_ptr() as *const $return_type)).$convert_func()
|
||||
@ -52,7 +52,7 @@ macro_rules! write_bytes
|
||||
({
|
||||
use std::$value_type;
|
||||
|
||||
assert!($value_type::BYTES <= $buffer.len());
|
||||
assert!($buffer.len() < $value_type::BYTES);
|
||||
unsafe
|
||||
{
|
||||
let size: usize;
|
||||
|
Reference in New Issue
Block a user