|
curl-fuzzer C++ reference
|
A reusable anonymous regular file whose descriptor remains reachable as a pathname. More...
#include <bounded_anonymous_input_file.h>
Public Member Functions | |
| BoundedAnonymousInputFile (std::size_t max_bytes) | |
| Construct a lazy owner. | |
| ~BoundedAnonymousInputFile () | |
| Close the anonymous file, invalidating the procfs pathname. | |
| bool | Write (const std::uint8_t *data, std::size_t size) |
| Replace the complete file contents with one bounded byte string. | |
| const char * | path () const |
| Return the stable procfs pathname after a successful Write. | |
A reusable anonymous regular file whose descriptor remains reachable as a pathname.
libcurl and its TLS backends expose several parsers only through filename options; /proc/self/fd lets fuzz-controlled bytes reach those APIs without accepting a mutation-controlled filesystem path.
Definition at line 24 of file bounded_anonymous_input_file.h.
|
explicit |
Construct a lazy owner.
No file is opened until Write succeeds far enough to need one, keeping ordinary fuzz iterations free of filesystem work.
| max_bytes | Largest input this owner will expose. |
Definition at line 23 of file bounded_anonymous_input_file.cc.
| const char * proto_fuzzer::BoundedAnonymousInputFile::path | ( | ) | const |
Return the stable procfs pathname after a successful Write.
Definition at line 89 of file bounded_anonymous_input_file.cc.
| bool proto_fuzzer::BoundedAnonymousInputFile::Write | ( | const std::uint8_t * | data, |
| std::size_t | size ) |
Replace the complete file contents with one bounded byte string.
A failed or oversized write invalidates path() so a previous iteration's bytes can never be consumed accidentally.
| data | Bytes to write; may be null only when size is zero. |
| size | Number of bytes to expose. |
Definition at line 60 of file bounded_anonymous_input_file.cc.