From fcb6dc13ed6efb066fb9b70405eecab8b83a2d96 Mon Sep 17 00:00:00 2001 From: Nick Galbreath Date: Sat, 12 Oct 2013 22:04:16 +0900 Subject: [PATCH] libinjection sync --- apache2/libinjection/libinjection.h | 2 +- apache2/libinjection/libinjection_sqli.c | 18 +----------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/apache2/libinjection/libinjection.h b/apache2/libinjection/libinjection.h index c599e0ea..1fefec28 100644 --- a/apache2/libinjection/libinjection.h +++ b/apache2/libinjection/libinjection.h @@ -19,7 +19,7 @@ extern "C" { * See python's normalized version * http://www.python.org/dev/peps/pep-0386/#normalizedversion */ -#define LIBINJECTION_VERSION "3.7.0" +#define LIBINJECTION_VERSION "3.7.1" /** * Libinjection's sqli module makes a "normalized" diff --git a/apache2/libinjection/libinjection_sqli.c b/apache2/libinjection/libinjection_sqli.c index d5d2806f..31cfc293 100644 --- a/apache2/libinjection/libinjection_sqli.c +++ b/apache2/libinjection/libinjection_sqli.c @@ -119,22 +119,6 @@ memchr2(const char *haystack, size_t haystack_len, char c0, char c1) return NULL; } -/** - * memchr might not exist on some systems - */ -static const char* -my_memchr(const char* haystack, size_t hlen, int needle) -{ - const char* cur; - const char* last = haystack + hlen; - for (cur = haystack; cur < last; ++cur) { - if (cur[0] == needle) { - return cur; - } - } - return NULL; -} - /** * memmem might not exist on some systems */ @@ -885,7 +869,7 @@ static size_t parse_bword(struct libinjection_sqli_state * sf) { const char *cs = sf->s; size_t pos = sf->pos; - const char* endptr = my_memchr(cs + pos, sf->slen - pos, ']'); + const char* endptr = (const char*) memchr(cs + pos, ']', sf->slen - pos); if (endptr == NULL) { st_assign(sf->current, TYPE_BAREWORD, pos, sf->slen - pos, cs + pos); return sf->slen;