Bug 217743 - sys/dev/mfi/mfi_tbolt.c: PVS-Studio: Expression is Always True (CWE-571)
Summary: sys/dev/mfi/mfi_tbolt.c: PVS-Studio: Expression is Always True (CWE-571)
Status: Closed Not Accepted
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-13 11:51 UTC by Svyatoslav
Modified: 2025-02-02 16:44 UTC (History)
3 users (show)

See Also:


Attachments
git patch (546 bytes, patch)
2017-03-13 11:51 UTC, Svyatoslav
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Svyatoslav 2017-03-13 11:51:26 UTC
Created attachment 180767 [details]
git patch

We have found and fixed a vulnerability using PVS-Studio tool. PVS-Studio is a static code analyzer for C, C++ and C#: https://www.viva64.com/en/pvs-studio/

Analyzer warning: V547 Expression 'cdb[0] != 0x28 || cdb[0] != 0x2A' is always true. Probably the '&&' operator should be used here. mfi_tbolt.c 1110
Comment 1 Warner Losh freebsd_committer freebsd_triage 2025-02-02 16:44:55 UTC
This patch is wrong. The inference was incorrect. svn r358689 applied this patch and it was reverted in 3567a05b56af266b346567a128847fe929d09423 which eliminated this code entirely. Turns out the expression was completely bogus and unnecessary.