File: BaseDecodeFuzz.cpp

package info (click to toggle)
scitokens-cpp 1.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,988 kB
  • sloc: cpp: 25,363; makefile: 14
file content (13 lines) | stat: -rw-r--r-- 376 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <jwt-cpp/base.h>

extern "C" {

int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size) {
	try {
		const auto bin = jwt::base::decode<jwt::alphabet::base64>(std::string{(char*)Data, Size});
	} catch (const std::runtime_error&) {
		// parse errors are ok, because input may be random bytes
	}
	return 0; // Non-zero return values are reserved for future use.
}
}