0

Take a look at my code sample:

std::vector<std::byte> body_buffer;
body_buffer.resize(10);

flatbuffers::Verifier verifier(reinterpret_cast<const uint8_t *>(body_buffer.data()), 10);
bool verify = flatbuffers::GetRoot<Vibranium::VerifyPacketRequest>(body_buffer.data())->Verify(verifier);

if(verify){
    std::cout << "VERIFIED!" << std::endl;
} else {
    std::cout << "NOT VERIFIED!" << std::endl;
}

I am basically giving empty vector of bytes to the verifier and it is giving back output of VERIFIED!.

Am I wrong or the verifier is not working? Am I doing something incorrectly ?

My intention was to provide to the verifier indeed ill data expecting it to catch that. However it does not. Why ?

Venelin
  • 2,905
  • 7
  • 53
  • 117
  • does this answer your question? https://stackoverflow.com/questions/37486992/flatbuffers-verifier-behaviour – 463035818_is_not_an_ai Nov 09 '20 at 14:15
  • @idclev463035818 not really. There in the answer is noted that it `checks that the data is structurally sound` .Okay than, I am giving it intentionally data that has no flatbuffers data in it. Why it is verifying it than ? – Venelin Nov 09 '20 at 14:20
  • You seem to have posted multiple questions asking the same thing.. don't do that? – Aardappel Nov 09 '20 at 17:55
  • Sorry. I have removed the other question. As you can see in this question I am using the verifier. Can you please tell if you see the problem in this question ? – Venelin Nov 09 '20 at 19:03

0 Answers0