From 503e8f6c8e52ed9ff883b596721c8a502a3d41bb Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Tue, 18 Feb 2014 05:06:58 -0800 Subject: [PATCH] Updates the libinjection Windows compilation was failing due to the utilization of size_t which is part of the strings.h. strings.h was not part of windows and so the compilation was failing. This update fix that. Issue #65 on libinjection: https://github.com/client9/libinjection/issues/65 --- apache2/libinjection/libinjection.h | 23 +++++++++++++++++++---- apache2/libinjection/libinjection_html5.h | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/apache2/libinjection/libinjection.h b/apache2/libinjection/libinjection.h index 4baf98c0..11b14ac5 100644 --- a/apache2/libinjection/libinjection.h +++ b/apache2/libinjection/libinjection.h @@ -11,9 +11,15 @@ #define _LIBINJECTION_H #ifdef __cplusplus -extern "C" { +# define LIBINJECTION_BEGIN_DECLS extern "C" { +# define LIBINJECTION_END_DECLS } +#else +# define LIBINJECTION_BEGIN_DECLS +# define LIBINJECTION_END_DECLS #endif +LIBINJECTION_BEGIN_DECLS + /* * Pull in size_t */ @@ -43,8 +49,17 @@ const char* libinjection_version(void); */ int libinjection_sqli(const char* s, size_t slen, char fingerprint[]); -#ifdef __cplusplus -} -#endif +/** ALPHA version of xss detector. + * + * NOT DONE. + * + * \param[in] s input string, may contain nulls, does not need to be null-terminated + * \param[in] slen input string length + * \return 1 if XSS found, 0 if benign + * + */ +int libinjection_xss(const char* s, size_t slen); + +LIBINJECTION_END_DECLS #endif /* _LIBINJECTION_H */ diff --git a/apache2/libinjection/libinjection_html5.h b/apache2/libinjection/libinjection_html5.h index bdaa94ec..29a14596 100644 --- a/apache2/libinjection/libinjection_html5.h +++ b/apache2/libinjection/libinjection_html5.h @@ -7,7 +7,7 @@ extern "C" { /* pull in size_t */ -#include +#include enum html5_type { DATA_TEXT