We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80dd7fa commit ce03401Copy full SHA for ce03401
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