File: decode_frame.cc

package info (click to toggle)
ngtcp2 0.12.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,240 kB
  • sloc: ansic: 48,169; cpp: 16,101; python: 2,262; makefile: 633; sh: 119
file content (25 lines) | stat: -rw-r--r-- 380 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifdef __cplusplus
extern "C" {
#endif

#include "ngtcp2_conn.h"

#ifdef __cplusplus
}
#endif

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  for (; size;) {
    ngtcp2_max_frame mfr{};

    auto nread = ngtcp2_pkt_decode_frame(&mfr.fr, data, size);
    if (nread < 0) {
      return 0;
    }

    data += nread;
    size -= nread;
  }

  return 0;
}