mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Code cosmetics: Reduces the amounts of warning.
Removes the warnings by adding missing headers and removed unused variables.
This commit is contained in:
parent
1e63e49db4
commit
385a2828e8
@ -67,7 +67,7 @@ char *normalize_path(modsec_rec *msr, char *input) {
|
||||
if(uri->path) {
|
||||
char *Uri = NULL;
|
||||
int bytes = 0;
|
||||
int i;
|
||||
/*int i;*/
|
||||
char *relative_link = NULL;
|
||||
char *filename = NULL;
|
||||
char *relative_path = NULL;
|
||||
|
@ -53,5 +53,8 @@ int DSOLOCAL json_complete(modsec_rec *msr, char **error_msg);
|
||||
|
||||
apr_status_t DSOLOCAL json_cleanup(modsec_rec *msr);
|
||||
|
||||
int DSOLOCAL json_process_chunk(modsec_rec *msr, const char *buf,
|
||||
unsigned int size, char **error_msg);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -227,7 +227,6 @@ int DSOLOCAL msc_status_engine_mac_address (unsigned char *mac)
|
||||
PIP_ADAPTER_INFO pAdapterInfo;
|
||||
PIP_ADAPTER_INFO pAdapter = NULL;
|
||||
DWORD dwRetVal = 0;
|
||||
UINT i;
|
||||
|
||||
ULONG ulOutBufLen = sizeof (IP_ADAPTER_INFO);
|
||||
pAdapterInfo = (IP_ADAPTER_INFO *)malloc(sizeof (IP_ADAPTER_INFO));
|
||||
|
@ -2053,7 +2053,6 @@ static int msre_op_detectXSS_execute(modsec_rec *msr, msre_rule *rule, msre_var
|
||||
char **error_msg) {
|
||||
|
||||
int is_xss;
|
||||
int capture;
|
||||
|
||||
is_xss = libinjection_xss(var->value, var->value_len);
|
||||
|
||||
|
@ -1993,7 +1993,6 @@ static int var_full_request_generate(modsec_rec *msr, msre_var *var,
|
||||
failed_fill_buffer:
|
||||
failed_not_enough_mem:
|
||||
failed_measure_buffer:
|
||||
no_buffer:
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This file should be auto-generated whenever modsecurity is configured as standalone.
|
||||
|
||||
CFLAGS="$CFLAGS \
|
||||
-I/usr/include/apr-1.0 \
|
||||
-I/usr/include/apr-1.0 -I/usr/include \
|
||||
@ -9,7 +7,8 @@ CFLAGS="$CFLAGS \
|
||||
-I/usr/include/libxml2 \
|
||||
-DWITH_LUA -I/usr/include/lua5.1 \
|
||||
-DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -DREQUEST_EARLY \
|
||||
"
|
||||
\
|
||||
-DWITH_YAJL -I/usr/include/yajl "
|
||||
|
||||
|
||||
CORE_LIBS="$CORE_LIBS \
|
||||
@ -20,7 +19,8 @@ CORE_LIBS="$CORE_LIBS \
|
||||
-lxml2 \
|
||||
-llua5.1 \
|
||||
-lpcre \
|
||||
-L/usr/lib -lcap"
|
||||
-L/usr/lib -lcap \
|
||||
-lyajl "
|
||||
|
||||
ngx_addon_name=ngx_http_modsecurity
|
||||
|
||||
|
@ -40,6 +40,10 @@
|
||||
|
||||
#include "api.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include "msc_status_engine.h"
|
||||
#endif
|
||||
|
||||
extern void *modsecLogObj;
|
||||
extern void (*modsecLogHook)(void *obj, int level, char *str);
|
||||
extern int (*modsecDropAction)(request_rec *r);
|
||||
@ -75,6 +79,7 @@ DECLARE_HOOK(void,insert_filter,(request_rec *r))
|
||||
DECLARE_HOOK(void,insert_error_filter,(request_rec *r))
|
||||
|
||||
char *sa_name = "standalone";
|
||||
const char *sa_name_argv[] = { "standalone", NULL };
|
||||
server_rec *server;
|
||||
apr_pool_t *pool = NULL;
|
||||
|
||||
@ -135,7 +140,7 @@ server_rec *modsecInit() {
|
||||
server->port = 80;
|
||||
server->process = apr_palloc(pool, sizeof(process_rec));
|
||||
server->process->argc = 1;
|
||||
server->process->argv = &sa_name;
|
||||
server->process->argv = sa_name_argv;
|
||||
server->process->pconf = pool;
|
||||
server->process->pool = pool;
|
||||
server->process->short_name = sa_name;
|
||||
@ -223,7 +228,6 @@ apr_status_t ap_http_in_filter(ap_filter_t *f, apr_bucket_brigade *bb_out,
|
||||
}
|
||||
|
||||
apr_status_t ap_http_out_filter(ap_filter_t *f, apr_bucket_brigade *b) {
|
||||
apr_status_t rc;
|
||||
apr_bucket_brigade *bb_out = (apr_bucket_brigade *)f->ctx;
|
||||
|
||||
APR_BRIGADE_CONCAT(bb_out, b);
|
||||
@ -662,9 +666,9 @@ int modsecFinishRequest(request_rec *r) {
|
||||
// destroy only the connection pool
|
||||
int modsecFinishConnection(conn_rec *c)
|
||||
{
|
||||
|
||||
apr_pool_destroy(c->pool);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -713,4 +717,4 @@ void modsecStatusEngineCall()
|
||||
"SecStatusEngine to On.\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user