We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3280bf8 commit d67638aCopy full SHA for d67638a
validation-test/Sanitizers/fuzzer.swift
@@ -17,9 +17,10 @@ import MSVCRT
17
#endif
18
19
@_cdecl("LLVMFuzzerTestOneInput")
20
-public func test(_ start: UnsafeRawPointer, _ count: Int) -> CInt {
+public func testHexDigits(_ start: UnsafeRawPointer, _ count: Int) -> CInt {
21
let bytes = UnsafeRawBufferPointer(start: start, count: count)
22
- if bytes.starts(with: "ABC".utf8) {
+ let string = String(decoding: bytes, as: Unicode.UTF8.self)
23
+ if let number = Int(string, radix: 16), (0x10...0xFF).contains(number) {
24
print("Crash!")
25
fflush(stdout)
26
exit(EXIT_FAILURE)
0 commit comments