diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
commit | a86c5f7cae7ec9a3398300555a0b644689d946a1 (patch) | |
tree | 39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /wsutil/ws_mempbrk.c | |
parent | Releasing progress-linux version 4.2.6-1~progress7.99u1. (diff) | |
download | wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.tar.xz wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.zip |
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wsutil/ws_mempbrk.c')
-rw-r--r-- | wsutil/ws_mempbrk.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/wsutil/ws_mempbrk.c b/wsutil/ws_mempbrk.c index f3f99b71..55334242 100644 --- a/wsutil/ws_mempbrk.c +++ b/wsutil/ws_mempbrk.c @@ -72,6 +72,21 @@ ws_mempbrk_exec(const uint8_t* haystack, size_t haystacklen, const ws_mempbrk_pa return ws_mempbrk_portable_exec(haystack, haystacklen, pattern, found_needle); } +WS_DLL_PUBLIC const uint8_t * +ws_memrpbrk_exec(const uint8_t* haystack, size_t haystacklen, const ws_mempbrk_pattern* pattern, unsigned char *found_needle) +{ + const uint8_t *haystack_end = haystack + haystacklen; + + while (haystack_end > haystack) { + if (pattern->patt[*(--haystack_end)]) { + if (found_needle) + *found_needle = *haystack_end; + return haystack_end; + } + } + + return NULL; +} /* * Editor modelines - https://www.wireshark.org/tools/modelines.html |