mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
libinjection sync
This commit is contained in:
@@ -19,7 +19,7 @@ extern "C" {
|
|||||||
* See python's normalized version
|
* See python's normalized version
|
||||||
* http://www.python.org/dev/peps/pep-0386/#normalizedversion
|
* 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"
|
* 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;
|
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
|
* 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;
|
const char *cs = sf->s;
|
||||||
size_t pos = sf->pos;
|
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) {
|
if (endptr == NULL) {
|
||||||
st_assign(sf->current, TYPE_BAREWORD, pos, sf->slen - pos, cs + pos);
|
st_assign(sf->current, TYPE_BAREWORD, pos, sf->slen - pos, cs + pos);
|
||||||
return sf->slen;
|
return sf->slen;
|
||||||
|
Reference in New Issue
Block a user