[clang-tools-extra] r337860 - [clangd] Guard fuzzer against empty inputs.
Benjamin Kramer via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 24 14:50:06 PDT 2018
Author: d0k
Date: Tue Jul 24 14:50:06 2018
New Revision: 337860
URL: http://llvm.org/viewvc/llvm-project?rev=337860&view=rev
Log:
[clangd] Guard fuzzer against empty inputs.
Modified:
clang-tools-extra/trunk/clangd/fuzzer/ClangdFuzzer.cpp
Modified: clang-tools-extra/trunk/clangd/fuzzer/ClangdFuzzer.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/fuzzer/ClangdFuzzer.cpp?rev=337860&r1=337859&r2=337860&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/fuzzer/ClangdFuzzer.cpp (original)
+++ clang-tools-extra/trunk/clangd/fuzzer/ClangdFuzzer.cpp Tue Jul 24 14:50:06 2018
@@ -20,6 +20,9 @@
#include <stdio.h>
extern "C" int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
+ if (size == 0)
+ return 0;
+
clang::clangd::JSONOutput Out(llvm::nulls(), llvm::nulls(),
clang::clangd::Logger::Error, nullptr);
clang::clangd::CodeCompleteOptions CCOpts;
More information about the cfe-commits
mailing list