Skip to content

Commit 385a282

Browse files
author
Felipe Zimmerle
committed
Code cosmetics: Reduces the amounts of warning.
Removes the warnings by adding missing headers and removed unused variables.
1 parent 1e63e49 commit 385a282

File tree

7 files changed

+16
-12
lines changed

7 files changed

+16
-12
lines changed

apache2/msc_crypt.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ char *normalize_path(modsec_rec *msr, char *input) {
6767
if(uri->path) {
6868
char *Uri = NULL;
6969
int bytes = 0;
70-
int i;
70+
/*int i;*/
7171
char *relative_link = NULL;
7272
char *filename = NULL;
7373
char *relative_path = NULL;

apache2/msc_json.h

+3
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,8 @@ int DSOLOCAL json_complete(modsec_rec *msr, char **error_msg);
5353

5454
apr_status_t DSOLOCAL json_cleanup(modsec_rec *msr);
5555

56+
int DSOLOCAL json_process_chunk(modsec_rec *msr, const char *buf,
57+
unsigned int size, char **error_msg);
58+
5659
#endif
5760
#endif

apache2/msc_status_engine.c

-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ int DSOLOCAL msc_status_engine_mac_address (unsigned char *mac)
227227
PIP_ADAPTER_INFO pAdapterInfo;
228228
PIP_ADAPTER_INFO pAdapter = NULL;
229229
DWORD dwRetVal = 0;
230-
UINT i;
231230

232231
ULONG ulOutBufLen = sizeof (IP_ADAPTER_INFO);
233232
pAdapterInfo = (IP_ADAPTER_INFO *)malloc(sizeof (IP_ADAPTER_INFO));

apache2/re_operators.c

-1
Original file line numberDiff line numberDiff line change
@@ -2053,7 +2053,6 @@ static int msre_op_detectXSS_execute(modsec_rec *msr, msre_rule *rule, msre_var
20532053
char **error_msg) {
20542054

20552055
int is_xss;
2056-
int capture;
20572056

20582057
is_xss = libinjection_xss(var->value, var->value_len);
20592058

apache2/re_variables.c

-1
Original file line numberDiff line numberDiff line change
@@ -1993,7 +1993,6 @@ static int var_full_request_generate(modsec_rec *msr, msre_var *var,
19931993
failed_fill_buffer:
19941994
failed_not_enough_mem:
19951995
failed_measure_buffer:
1996-
no_buffer:
19971996
return 0;
19981997
}
19991998

nginx/modsecurity/config

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
#!/bin/sh
22

3-
# This file should be auto-generated whenever modsecurity is configured as standalone.
4-
53
CFLAGS="$CFLAGS \
64
-I/usr/include/apr-1.0 \
75
-I/usr/include/apr-1.0 -I/usr/include \
86
-I/usr/include/apache2 \
97
-I/usr/include/libxml2 \
108
-DWITH_LUA -I/usr/include/lua5.1 \
119
-DWITH_PCRE_STUDY -DMODSEC_PCRE_MATCH_LIMIT=1500 -DMODSEC_PCRE_MATCH_LIMIT_RECURSION=1500 -DREQUEST_EARLY \
12-
"
10+
\
11+
-DWITH_YAJL -I/usr/include/yajl "
1312

1413

1514
CORE_LIBS="$CORE_LIBS \
@@ -20,7 +19,8 @@ CORE_LIBS="$CORE_LIBS \
2019
-lxml2 \
2120
-llua5.1 \
2221
-lpcre \
23-
-L/usr/lib -lcap"
22+
-L/usr/lib -lcap \
23+
-lyajl "
2424

2525
ngx_addon_name=ngx_http_modsecurity
2626

standalone/api.c

+8-4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040

4141
#include "api.h"
4242

43+
#ifdef WIN32
44+
#include "msc_status_engine.h"
45+
#endif
46+
4347
extern void *modsecLogObj;
4448
extern void (*modsecLogHook)(void *obj, int level, char *str);
4549
extern int (*modsecDropAction)(request_rec *r);
@@ -75,6 +79,7 @@ DECLARE_HOOK(void,insert_filter,(request_rec *r))
7579
DECLARE_HOOK(void,insert_error_filter,(request_rec *r))
7680

7781
char *sa_name = "standalone";
82+
const char *sa_name_argv[] = { "standalone", NULL };
7883
server_rec *server;
7984
apr_pool_t *pool = NULL;
8085

@@ -135,7 +140,7 @@ server_rec *modsecInit() {
135140
server->port = 80;
136141
server->process = apr_palloc(pool, sizeof(process_rec));
137142
server->process->argc = 1;
138-
server->process->argv = &sa_name;
143+
server->process->argv = sa_name_argv;
139144
server->process->pconf = pool;
140145
server->process->pool = pool;
141146
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,
223228
}
224229

225230
apr_status_t ap_http_out_filter(ap_filter_t *f, apr_bucket_brigade *b) {
226-
apr_status_t rc;
227231
apr_bucket_brigade *bb_out = (apr_bucket_brigade *)f->ctx;
228232

229233
APR_BRIGADE_CONCAT(bb_out, b);
@@ -662,9 +666,9 @@ int modsecFinishRequest(request_rec *r) {
662666
// destroy only the connection pool
663667
int modsecFinishConnection(conn_rec *c)
664668
{
665-
666669
apr_pool_destroy(c->pool);
667670

671+
return 0;
668672
}
669673

670674

@@ -713,4 +717,4 @@ void modsecStatusEngineCall()
713717
"SecStatusEngine to On.\n");
714718
}
715719
}
716-
#endif
720+
#endif

0 commit comments

Comments
 (0)