Skip to content

Commit

Permalink
Merge pull request #138 from client9/remotes/trunk
Browse files Browse the repository at this point in the history
libinjection sync
  • Loading branch information
brenosilva committed Sep 3, 2013
2 parents 7e0a9ec + 2268626 commit 414033a
Show file tree
Hide file tree
Showing 3 changed files with 568 additions and 546 deletions.
14 changes: 11 additions & 3 deletions apache2/libinjection/libinjection.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extern "C" {
* See python's normalized version
* http://www.python.org/dev/peps/pep-0386/#normalizedversion
*/
#define LIBINJECTION_VERSION "3.4.1"
#define LIBINJECTION_VERSION "3.5.3"

/**
* Libinjection's sqli module makes a "normalized"
Expand All @@ -37,6 +37,13 @@ extern "C" {
#define LIBINJECTION_SQLI_MAX_TOKENS 5
#endif

#if LIBINJECTION_SQLI_MAX_TOKENS >= 8
#define LIBINJECTION_SQLI_BUFFER_SZ (LIBINJECTION_SQLI_MAX_TOKENS + 1)
#else
#define LIBINJECTION_SQLI_BUFFER_SZ 8
#endif


enum lookup_type {
FLAG_NONE = 0,
FLAG_QUOTE_NONE = 1 << 1,
Expand Down Expand Up @@ -119,7 +126,7 @@ typedef struct libinjection_sqli_state {
/* MAX TOKENS + 1 since we use one extra token
* to determine the type of the previous token
*/
stoken_t tokenvec[LIBINJECTION_SQLI_MAX_TOKENS + 1];
stoken_t tokenvec[LIBINJECTION_SQLI_BUFFER_SZ];

/*
* Pointer to token position in tokenvec, above
Expand All @@ -129,8 +136,9 @@ typedef struct libinjection_sqli_state {
/*
* fingerprint pattern c-string
* +1 for ending null
* Mimimum of 8 bytes to add gcc's -fstack-protector to work
*/
char fingerprint[LIBINJECTION_SQLI_MAX_TOKENS + 1];
char fingerprint[LIBINJECTION_SQLI_BUFFER_SZ];

/*
* Line number of code that said decided if the input was SQLi or
Expand Down
Loading

0 comments on commit 414033a

Please sign in to comment.