mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 11:16:33 +03:00
libinjection sync
This commit is contained in:
@@ -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"
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user