Add pdf_fx_date_helpers_fuzzer target.

Change-Id: Ic7191267628ce765b26a39debeb87d175d0a69fc
Reviewed-on: https://pdfium-review.googlesource.com/c/45131
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/testing/fuzzers/BUILD.gn b/testing/fuzzers/BUILD.gn
index ccee96b..1451467 100644
--- a/testing/fuzzers/BUILD.gn
+++ b/testing/fuzzers/BUILD.gn
@@ -39,7 +39,10 @@
     ":pdfium_fuzzer_src",
   ]
   if (pdf_enable_v8) {
-    deps += [ ":pdf_cjs_util_fuzzer_src" ]
+    deps += [
+      ":pdf_cjs_util_fuzzer_src",
+      ":pdf_fx_date_helpers_fuzzer_src",
+    ]
   }
   if (pdf_enable_xfa) {
     deps += [
@@ -128,6 +131,14 @@
       "../../fxjs",
     ]
   }
+  pdfium_fuzzer("pdf_fx_date_helpers_fuzzer_src") {
+    sources = [
+      "pdf_fx_date_helpers_fuzzer.cc",
+    ]
+    deps = [
+      "../../fxjs",
+    ]
+  }
 }
 
 if (pdf_enable_xfa) {
diff --git a/testing/fuzzers/pdf_fx_date_helpers_fuzzer.cc b/testing/fuzzers/pdf_fx_date_helpers_fuzzer.cc
new file mode 100644
index 0000000..ff81c47
--- /dev/null
+++ b/testing/fuzzers/pdf_fx_date_helpers_fuzzer.cc
@@ -0,0 +1,23 @@
+// Copyright 2018 The PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <string>
+
+#include "core/fxcrt/widestring.h"
+#include "fxjs/fx_date_helpers.h"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  auto* short_data = reinterpret_cast<const unsigned short*>(data);
+  size_t short_size = size / sizeof(unsigned short);
+  if (short_size > 2) {
+    double ignore;
+    size_t short_len1 = short_size / 2;
+    size_t short_len2 = short_size - short_len1;
+    WideString input1 = WideString::FromUTF16LE(short_data, short_len1);
+    WideString input2 =
+        WideString::FromUTF16LE(short_data + short_len1, short_len2);
+    FX_ParseDateUsingFormat(input1, input2, &ignore);
+  }
+  return 0;
+}