Skip to content

Commit

Permalink
Include missing stdint.h on fuzz test (#1700)
Browse files Browse the repository at this point in the history
* Include missing stdint.h

* Remove std:: from uint8_t
  • Loading branch information
jimmy-park authored Oct 29, 2023
1 parent e2813d9 commit d0e4cb3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion test/fuzzing/server_fuzzer.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <cstdint>

#include <httplib.h>
#include <memory>

class FuzzedStream : public httplib::Stream {
public:
Expand Down
6 changes: 3 additions & 3 deletions test/fuzzing/standalone_fuzz_target_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
// on the test corpus or on a single file,
// e.g. the one that comes from a bug report.

#include <cassert>
#include <iostream>
#include <cstdint>
#include <fstream>
#include <iostream>
#include <vector>

// Forward declare the "fuzz target" interface.
Expand All @@ -21,7 +21,7 @@ int main(int argc, char **argv) {
std::ifstream in(argv[i]);
in.seekg(0, in.end);
size_t length = static_cast<size_t>(in.tellg());
in.seekg (0, in.beg);
in.seekg(0, in.beg);
std::cout << "Reading " << length << " bytes from " << argv[i] << std::endl;
// Allocate exactly length bytes so that we reliably catch buffer overflows.
std::vector<char> bytes(length);
Expand Down

0 comments on commit d0e4cb3

Please sign in to comment.