diff --git a/src/util-mpm-ac-gfbs.c b/src/util-mpm-ac-gfbs.c index e52517e933..dc88e37664 100644 --- a/src/util-mpm-ac-gfbs.c +++ b/src/util-mpm-ac-gfbs.c @@ -1280,6 +1280,14 @@ uint32_t SCACGfbsSearch(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx, if (no_of_entries[0] == 0) { temp_state = SC_AC_GFBS_FAIL; } else { + if (no_of_entries[0] == 1) { + ascii_codes = no_of_entries + 1; + buf_local = u8_tolower(buf[i]); + if (buf_local == ascii_codes[0]) + temp_state = ((SC_AC_GFBS_STATE_TYPE_U32 *)(ascii_codes + no_of_entries[0]))[0]; + else + temp_state = SC_AC_GFBS_FAIL; + } else { ascii_codes = no_of_entries + 1; buf_local = u8_tolower(buf[i]); if (state == 0) { @@ -1301,6 +1309,7 @@ uint32_t SCACGfbsSearch(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx, } } } + } } while (temp_state == SC_AC_GFBS_FAIL) { state = failure_table[state]; @@ -1310,6 +1319,14 @@ uint32_t SCACGfbsSearch(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx, if (no_of_entries[0] == 0) { temp_state = SC_AC_GFBS_FAIL; } else { + if (no_of_entries[0] == 1) { + ascii_codes = no_of_entries + 1; + buf_local = u8_tolower(buf[i]); + if (buf_local == ascii_codes[0]) + temp_state = ((SC_AC_GFBS_STATE_TYPE_U32 *)(ascii_codes + no_of_entries[0]))[0]; + else + temp_state = SC_AC_GFBS_FAIL; + } else { ascii_codes = no_of_entries + 1; buf_local = u8_tolower(buf[i]); if (state == 0) { @@ -1331,6 +1348,7 @@ uint32_t SCACGfbsSearch(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx, } } } + } } /* else - if (no_of_entries[0] == 0) */ } /* while (temp_state == SC_AC_GFBS_FAIL) */ state = temp_state;