Added SonarCloud exclusions for third-party files and files lacking relevance.

* fixed two other "bugs"

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni Uhlig
2023-11-20 14:32:11 +01:00
parent f38f1ec37f
commit bb9f02719d
3 changed files with 3 additions and 2 deletions

View File

@@ -119,7 +119,7 @@ struct distributor_global_user_data
{ {
int do_hash_checks; int do_hash_checks;
} options; } options;
}; } __attribute__((__packed__));
struct distributor_flow_user_data struct distributor_flow_user_data
{ {

View File

@@ -1062,7 +1062,7 @@ static int new_connection(struct nio * const io, int eventfd)
pwsiz = BUFSIZ; pwsiz = BUFSIZ;
} }
char buf[pwsiz]; char buf[pwsiz];
if (getpwuid_r(ucred.uid, &pwnam, &buf[0], pwsiz, &pwres) != 0) if (getpwuid_r(ucred.uid, &pwnam, &buf[0], pwsiz, &pwres) != 0 || pwres == NULL)
{ {
logger(1, "Could not get passwd entry for user id %u", ucred.uid); logger(1, "Could not get passwd entry for user id %u", ucred.uid);
return 1; return 1;

View File

@@ -6,3 +6,4 @@ sonar.projectVersion=1.5
sonar.sourceEncoding=UTF-8 sonar.sourceEncoding=UTF-8
sonar.sources=*.c,*.h,dependencies/nDPIsrvd.h,dependencies/nDPIsrvd.py,examples/c-*/**,examples/cxx-*/**,examples/py-*/** sonar.sources=*.c,*.h,dependencies/nDPIsrvd.h,dependencies/nDPIsrvd.py,examples/c-*/**,examples/cxx-*/**,examples/py-*/**
sonar.exclusions = dependencies/jsmn/** dependencies/uthash/** examples/js-rt-analyzer-frontend/** examples/js-rt-analyzer/** examples/c-collectd/www/** examples/py-flow-dashboard/assets/**