diff --git a/src/hwlm/hwlm.h b/src/hwlm/hwlm.h index a17575df..00561346 100644 --- a/src/hwlm/hwlm.h +++ b/src/hwlm/hwlm.h @@ -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; diff --git a/src/hwlm/hwlm_literal.h b/src/hwlm/hwlm_literal.h index 0e2a1ea5..9ae7744d 100644 --- a/src/hwlm/hwlm_literal.h +++ b/src/hwlm/hwlm_literal.h @@ -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 diff --git a/src/hwlm/noodle_engine.c b/src/hwlm/noodle_engine.c index 4897eb09..cdc07dfc 100644 --- a/src/hwlm/noodle_engine.c +++ b/src/hwlm/noodle_engine.c @@ -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);