Skip to content

Commit d222d70

Browse files
committed
fix: expand asserts in fuzz_support.cc
1 parent e1c38b4 commit d222d70

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

testing/fuzzing/fuzz_support.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,19 @@ static constexpr Network_Funcs fuzz_network_funcs = {
6969
/* .listen = */ ![](Fuzz_System *self, int sock, int backlog) { return 0; },
7070
/* .recvbuf = */
7171
![](Fuzz_System *self, int sock) {
72-
assert(sock == 42);
72+
assert(sock == 42 || sock == 1337);
7373
const size_t count = random_u16(self->rng.get());
7474
return static_cast<int>(std::min(count, self->data.size));
7575
},
7676
/* .recv = */
7777
![](Fuzz_System *self, int sock, uint8_t *buf, size_t len) {
78-
assert(sock == 42);
78+
assert(sock == 42 || sock == 1337);
7979
// Receive data from the fuzzer.
8080
return recv_common(self->data, buf, len);
8181
},
8282
/* .recvfrom = */
8383
![](Fuzz_System *self, int sock, uint8_t *buf, size_t len, Network_Addr *addr) {
84-
assert(sock == 42);
84+
assert(sock == 42 || sock == 1337);
8585

8686
addr->addr = sockaddr_storage{};
8787
// Dummy Addr
@@ -97,13 +97,13 @@ static constexpr Network_Funcs fuzz_network_funcs = {
9797
},
9898
/* .send = */
9999
![](Fuzz_System *self, int sock, const uint8_t *buf, size_t len) {
100-
assert(sock == 42);
100+
assert(sock == 42 || sock == 1337);
101101
// Always succeed.
102102
return static_cast<int>(len);
103103
},
104104
/* .sendto = */
105105
![](Fuzz_System *self, int sock, const uint8_t *buf, size_t len, const Network_Addr *addr) {
106-
assert(sock == 42);
106+
assert(sock == 42 || sock == 1337);
107107
// Always succeed.
108108
return static_cast<int>(len);
109109
},

0 commit comments

Comments
 (0)