mirror of
https://github.com/troglobit/finit.git
synced 2026-11-03 13:28:27 +00:00
Silence false positive from Coverity Scan
51static int is_dir_empty(const char *path)
52{
1. var_decl: Declaring variable namelist without initializer.
53 struct dirent **namelist;
54 int num;
55
CID 898746: (#1 of 1): Uninitialized pointer read (UNINIT)
2. uninit_use_in_call: Using uninitialized value namelist when calling scandir.
56 num = scandir(path, &namelist, NULL, NULL);
57 if (num < 0)
58 return 0;
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -95,7 +95,7 @@ static void run_env(const char *env[])
|
|||||||
int run_parts(char *dir, char *cmd, const char *env[], int progress, int sysv)
|
int run_parts(char *dir, char *cmd, const char *env[], int progress, int sysv)
|
||||||
{
|
{
|
||||||
size_t cmdlen = cmd ? strlen(cmd) : strlen("start");
|
size_t cmdlen = cmd ? strlen(cmd) : strlen("start");
|
||||||
struct dirent **d;
|
struct dirent **d = NULL;
|
||||||
int i, num;
|
int i, num;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -50,7 +50,7 @@ int r_flag = 0;
|
|||||||
|
|
||||||
static int is_dir_empty(const char *path)
|
static int is_dir_empty(const char *path)
|
||||||
{
|
{
|
||||||
struct dirent **namelist;
|
struct dirent **namelist = NULL;
|
||||||
int num;
|
int num;
|
||||||
|
|
||||||
num = scandir(path, &namelist, NULL, NULL);
|
num = scandir(path, &namelist, NULL, NULL);
|
||||||
|
|||||||
Reference in new issue
Block a user