| 102 | |
| 103 | #if defined(PROVIDE_FUZZ_MAIN_FUNCTION) |
| 104 | static bool read_stdin(std::vector<uint8_t>& data) |
| 105 | { |
| 106 | uint8_t buffer[1024]; |
| 107 | ssize_t length = 0; |
| 108 | while ((length = read(STDIN_FILENO, buffer, 1024)) > 0) { |
| 109 | data.insert(data.end(), buffer, buffer + length); |
| 110 | } |
| 111 | return length == 0; |
| 112 | } |
| 113 | #endif |
| 114 | |
| 115 | // This function is used by libFuzzer |