misc: ss.c: fix logical error in main function
Subsystems (2)
PATCH 1/1 misc: ss.c: fix logical error in main function
In the line if (!dump_tcpdiag) { there was a logical error in checking the descriptor, which the static analyzer complained about (this action is always false)
fixed by replacing !dump_tcpdiag with !dump_fp
--- misc/ss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
misc/ss.c +1 -1
@@ -6228,7 +6228,7 @@ int main(int argc, char *argv[]) }if (dump_tcpdiag[0 ] !='-' ) { dump_fp =fopen (dump_tcpdiag,"w" ); -if (!dump_tcpdiag) { +if (!dump_fp) {perror ("fopen dump file" );exit (-1 ); }
Signature · 1 line
2.39.2
Quoted 8 lines · On Sat, 19 Jul 2025 19:31:22 +0300 Anton Moryakov <[email protected]>…
In the line if (!dump_tcpdiag) { there was a logical error in checking the descriptor, which the static analyzer complained about (this action is always false)
fixed by replacing !dump_tcpdiag with !dump_fp
Reported-by SVACE static analyzerSigned-off-by Anton Moryakov <[email protected]>
This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:
Hello:
This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:
Quoted 10 lines · On Sat, 19 Jul 2025 19:31:22 +0300 you wrote:
In the line if (!dump_tcpdiag) { there was a logical error in checking the descriptor, which the static analyzer complained about (this action is always false)
fixed by replacing !dump_tcpdiag with !dump_fp
Reported-by SVACE static analyzerSigned-off-by Anton Moryakov <[email protected]>[...]
Here is the summary with links:
- [iproute2-next] misc: ss.c: fix logical error in main function
https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=27d11a81197c
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html