Skip to content

Commit

Permalink
fix: remove old safety checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jaromil committed Jan 31, 2025
1 parent d80bc23 commit afc6232
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
13 changes: 5 additions & 8 deletions src/zen_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@

int fuzz_byte_random(lua_State *L) {
BEGIN();
octet *o = o_arg(L, 1);
SAFE(o);
const octet *o = o_arg(L, 1);
if(o->len >= INT_MAX) {
o_free(L,o);
THROW("fuzz_byte: octet too big");
Expand Down Expand Up @@ -74,7 +73,7 @@ int fuzz_byte_random(lua_State *L) {

int fuzz_byte_xor(lua_State *L) {
BEGIN();
octet *o = o_arg(L,1); SAFE(o);
const octet *o = o_arg(L,1);
if(o->len >= INT_MAX) {
o_free(L,o);
THROW("fuzz_byte: octet too big");
Expand Down Expand Up @@ -107,7 +106,7 @@ int fuzz_byte_xor(lua_State *L) {

int fuzz_bit_random(lua_State *L) {
BEGIN();
octet *o = o_arg(L,1); SAFE(o);
const octet *o = o_arg(L,1);
if(o->len >= INT_MAX) {
o_free(L,o);
THROW("fuzz_byte: octet too big");
Expand Down Expand Up @@ -188,7 +187,7 @@ void OCT_circular_shl_bits(octet *x, int n) {

int fuzz_byte_circular_shift_random(lua_State *L) {
BEGIN();
octet *o = o_arg(L,1); SAFE(o);
const octet *o = o_arg(L,1);
if(o->len >= INT_MAX) {
o_free(L,o);
THROW("fuzz_byte: octet too big");
Expand Down Expand Up @@ -233,9 +232,7 @@ int fuzz_byte_circular_shift_random(lua_State *L) {

int fuzz_bit_circular_shift_random(lua_State *L) {
BEGIN();
octet *o = o_arg(L, 1);
SAFE(o);

const octet *o = o_arg(L, 1);
if (o->len >= INT_MAX) {
o_free(L, o);
THROW("fuzz_byte: octet too big");
Expand Down
8 changes: 4 additions & 4 deletions src/zen_octet.c
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,7 @@ This is also executed when using the 'o << n' with o an octet and n an integer *
static int shift_left(lua_State *L) {
BEGIN();
char *failed_msg = NULL;
octet *o = o_arg(L,1); SAFE(o);
const octet *o = o_arg(L,1);
int isnum;
lua_Integer n = lua_tointegerx(L,2,&isnum);
if(!isnum) {
Expand Down Expand Up @@ -2080,7 +2080,7 @@ void OCT_shr_bits(octet *x, int n) {
static int shift_right(lua_State *L) {
BEGIN();
char *failed_msg = NULL;
octet *o = o_arg(L,1); SAFE(o);
const octet *o = o_arg(L,1);
int isnum;
lua_Integer n = lua_tointegerx(L,2,&isnum);
if(!isnum) {
Expand Down Expand Up @@ -2110,7 +2110,7 @@ static int shift_right(lua_State *L) {
static int shift_left_circular(lua_State *L) {
BEGIN();
char *failed_msg = NULL;
octet *o = o_arg(L,1); SAFE(o);
const octet *o = o_arg(L,1);
int isnum;
lua_Integer n = lua_tointegerx(L,2,&isnum);
if(!isnum) {
Expand Down Expand Up @@ -2171,7 +2171,7 @@ void OCT_circular_shr_bits(octet *x, int n) {
static int shift_right_circular(lua_State *L) {
BEGIN();
char *failed_msg = NULL;
octet *o = o_arg(L,1); SAFE(o);
const octet *o = o_arg(L,1);
int isnum;
lua_Integer n = lua_tointegerx(L,2,&isnum);
if(!isnum) {
Expand Down

0 comments on commit afc6232

Please sign in to comment.