Skip to content

Commit 503e8f6

Browse files
author
Felipe Zimmerle
committed
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: client9/libinjection#65
1 parent 66939d0 commit 503e8f6

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

apache2/libinjection/libinjection.h

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@
1111
#define _LIBINJECTION_H
1212

1313
#ifdef __cplusplus
14-
extern "C" {
14+
# define LIBINJECTION_BEGIN_DECLS extern "C" {
15+
# define LIBINJECTION_END_DECLS }
16+
#else
17+
# define LIBINJECTION_BEGIN_DECLS
18+
# define LIBINJECTION_END_DECLS
1519
#endif
1620

21+
LIBINJECTION_BEGIN_DECLS
22+
1723
/*
1824
* Pull in size_t
1925
*/
@@ -43,8 +49,17 @@ const char* libinjection_version(void);
4349
*/
4450
int libinjection_sqli(const char* s, size_t slen, char fingerprint[]);
4551

46-
#ifdef __cplusplus
47-
}
48-
#endif
52+
/** ALPHA version of xss detector.
53+
*
54+
* NOT DONE.
55+
*
56+
* \param[in] s input string, may contain nulls, does not need to be null-terminated
57+
* \param[in] slen input string length
58+
* \return 1 if XSS found, 0 if benign
59+
*
60+
*/
61+
int libinjection_xss(const char* s, size_t slen);
62+
63+
LIBINJECTION_END_DECLS
4964

5065
#endif /* _LIBINJECTION_H */

apache2/libinjection/libinjection_html5.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extern "C" {
77

88
/* pull in size_t */
99

10-
#include <strings.h>
10+
#include <stddef.h>
1111

1212
enum html5_type {
1313
DATA_TEXT

0 commit comments

Comments
 (0)