cisco / joy

A package for capturing and analyzing network flow data and intraflow data, for network research, forensics, and security monitoring.
Other
1.3k stars 329 forks source link

Potential uninitialized variable #266

Closed QiAnXinCodeSafe closed 5 years ago

QiAnXinCodeSafe commented 5 years ago

variable 'output_dir' declared here, without initialization: https://github.com/cisco/joy/blob/5dd5b71bc1fe71ff0d0cf1b6263e6f5449cd622d/src/joy.c#L928

the value of 'output_dir' is set in if block; https://github.com/cisco/joy/blob/5dd5b71bc1fe71ff0d0cf1b6263e6f5449cd622d/src/joy.c#L941-L957

while using this variable such as in line 994, may a potential uninitialized variable is used: https://github.com/cisco/joy/blob/5dd5b71bc1fe71ff0d0cf1b6263e6f5449cd622d/src/joy.c#L994

bhudson33 commented 5 years ago

usage occurs inside the same condition check that occurs when setting the variable. Therefore, the variable will be initialized if it is going to be used.