]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Move hwlm literal len define
authorMatthew Barr <matthew.barr@intel.com>
Mon, 26 Jun 2017 00:15:49 +0000 (10:15 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Mon, 21 Aug 2017 01:10:20 +0000 (11:10 +1000)
src/hwlm/hwlm.h
src/hwlm/hwlm_literal.h
src/hwlm/noodle_engine.c

index a17575dfda84c70a4051023fda38c219f60efc48..005613461154bd399618c51773c14301d681026b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2016, Intel Corporation
+ * Copyright (c) 2015-2017, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -71,6 +71,9 @@ typedef hwlm_group_t hwlmcb_rv_t;
  * designed for a different architecture). */
 #define HWLM_ERROR_UNKNOWN 2
 
+/** \brief Max length of the literal passed to HWLM. */
+#define HWLM_LITERAL_MAX_LEN 8
+
 struct hs_scratch;
 struct HWLM;
 
index 0e2a1ea5dc28a00c351d6d84a4081fb2e295a40b..9ae7744de7f145e8ac874310a0085fd33a4265ab 100644 (file)
@@ -42,9 +42,6 @@
 
 namespace ue2 {
 
-/** \brief Max length of the literal passed to HWLM. */
-#define HWLM_LITERAL_MAX_LEN 8
-
 /** \brief Max length of the hwlmLiteral::msk and hwlmLiteral::cmp vectors. */
 #define HWLM_MASKLEN 8
 
index 4897eb091c33f4859a5ac4a01a69e3a4d9aadb18..cdc07dfc40a0bc54b9da4cc760ad27b26b116d9f 100644 (file)
@@ -380,7 +380,8 @@ hwlm_error_t noodExecStreaming(const struct noodTable *n, const u8 *hbuf,
     if (hlen) {
         assert(hbuf);
 
-        u8 ALIGN_DIRECTIVE temp_buf[16]; // HWLM_LITERAL_MAX_LEN * 2
+        u8 ALIGN_DIRECTIVE temp_buf[HWLM_LITERAL_MAX_LEN * 2];
+        memset(temp_buf, 0, sizeof(temp_buf));
 
         size_t tl1 = MIN(n->len - 1, hlen);
         size_t tl2 = MIN(n->len - 1, len);