Project

General

Profile

Bug #3083

crypto/openssh/auth2-pubkey.c:186]: (style) Suspicious condition

Added by dcb about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
10/17/2017
Due date:
% Done:

0%


Description

crypto/openssh/auth2-pubkey.c:186]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.

Source code is

if ((r = sshbuf_put_cstring(b, "publickey")) != 0 ||
(r = sshbuf_put_u8(b, have_sig)) != 0 ||
(r = sshbuf_put_cstring(b, pkalg) != 0))

Maybe better code

if ((r = sshbuf_put_cstring(b, "publickey")) != 0 ||
(r = sshbuf_put_u8(b, have_sig)) != 0 ||
(r = sshbuf_put_cstring(b, pkalg)) != 0)

Also available in: Atom PDF