Skip to content

Commit ff9152e

Browse files
committed
Cosmetics: address cppcheck warnings on src/utils
1 parent ff59017 commit ff9152e

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

src/utils/base64.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ void Base64::decode_forgiven_engine(unsigned char *plain_text,
152152
ch = b64_reverse_t[ch];
153153
if (ch < 0) {
154154
continue;
155-
} else if (ch == -2) {
155+
/*} else if (ch == -2) {
156156
*aiming_size = 0;
157-
return;
157+
return;*/
158158
}
159159
switch (i % 4) {
160160
case 0:

src/utils/geo_lookup.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ class GeoLookup {
5454

5555
private:
5656
GeoLookup() :
57+
m_version(NOT_LOADED)
5758
#if WITH_GEOIP
58-
m_gi(NULL),
59+
,m_gi(NULL)
5960
#endif
60-
m_version(NOT_LOADED) { }
61+
{ }
6162
~GeoLookup();
6263
GeoLookup(GeoLookup const&);
6364
void operator=(GeoLookup const&);

src/utils/shared_files.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,13 @@ class SharedFiles {
7575
private:
7676
SharedFiles()
7777
#ifdef MODSEC_USE_GENERAL_LOCK
78-
: m_generalLock(NULL)
78+
: m_generalLock(NULL),
79+
m_memKeyStructure(0)
7980
#endif
8081
{
8182
#ifdef MODSEC_USE_GENERAL_LOCK
8283
int shm_id;
83-
bool toBeCreated = true;
84+
bool toBeCreated;
8485
bool err = false;
8586

8687
m_memKeyStructure = ftok(".", 1);
@@ -122,7 +123,6 @@ class SharedFiles {
122123
err_shmat1:
123124
std::cerr << "err_shmat1" << std::endl;
124125
}
125-
toBeCreated = false;
126126
#endif
127127
}
128128
~SharedFiles() {

test/cppcheck_suppressions.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,7 @@ functionStatic:headers/modsecurity/transaction.h:374
7171

7272
functionStatic:src/operators/geo_lookup.h:35
7373
useInitializationList:src/operators/rbl.h:69
74+
75+
unmatchedSuppression:src/utils/geo_lookup.cc:82
76+
useInitializationList:src/utils/shared_files.h:87
77+
unmatchedSuppression:src/utils/msc_tree.cc

0 commit comments

Comments
 (0)