Project

General

Profile

Bug #3123

crypto/openssh/channels.c:3258: bad if statement ?

Added by dcb 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
02/22/2018
Due date:
% Done:

0%

Estimated time:

Description

crypto/openssh/channels.c:3258]: (warning) The expression 'strcmp(listen_addr,"localhost") != 0' is suspicious. It overlaps 'strcmp(listen_addr,"127.0.0.1") == 0'.

Source code is

} else if (strcmp(listen_addr, "localhost") != 0 ||
strcmp(listen_addr, "127.0.0.1") == 0 ||
strcmp(listen_addr, "::1") == 0) {

maybe better code

} else if (strcmp(listen_addr, "localhost") == 0 ||
strcmp(listen_addr, "127.0.0.1") == 0 ||
strcmp(listen_addr, "::1") == 0) {

Also available in: Atom PDF