Skip to content

Commit

Permalink
tests: fix a buffer overread in a unit test
Browse files Browse the repository at this point in the history
and remove a leftover debugging sanity check
  • Loading branch information
moneromooo-monero committed Dec 18, 2017
1 parent b452489 commit 56fa6ce
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tests/unit_tests/slow_memmem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ static const struct {
{1,"x",1,"x",0},
{2,"x",1,"",1},
{1,"x",1,"",0},
{1,"x",2,"",0},
{1,"x",2,"x",0},
{2,"ax",2,"x",0},
{1,"xx",2,"xx",0},
Expand All @@ -103,7 +102,7 @@ static const struct {
{8,"xxxxxxab",3,"xyz",0},
{8,"xxxxxxab",6,"abcdef",0},
{9,"\0xxxxxab",3,"ab",6},
{4,"\0\0a",3,"\0a",1},
{4,"\0\0a",3,"\0a",1}, //
};

TEST(slowmem,Success)
Expand All @@ -122,7 +121,6 @@ TEST(slowmem,Success)
free(pat);
free(buf);
ASSERT_EQ(res,T[n].res);
ASSERT_EQ(1,1);
#ifdef VERBOSE
if (res!=T[n].res) printf("failed (got %zu, expected %zu)",res,T[n].res); else printf("ok");
printf("\n");
Expand Down

0 comments on commit 56fa6ce

Please sign in to comment.