forked from opentibiabr/canary
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: exception handling, switch/if chain and others (opentibiabr#798)
This fixes exception handling, switch/if chain, uninitialized variable, combat null pointers, and signed/unsigned comparison issues. Fixes several issues identified in the codebase. Firstly, it ensures that proper exception handling is in place to prevent unexpected termination of the program. Secondly, it eliminates the redundancy in switch and if chains by making sure that each branch has a unique implementation. Thirdly, it eliminates potential bugs caused by uninitialized variables by initializing all non-class type fields. Fourthly, it replaces dangerous comparison between signed and unsigned integers with std::cmp_* functions from C++20 to prevent counterintuitive results and lossy integer conversion. This improves the overall stability and security of the program.
- Loading branch information
Showing
6 changed files
with
15 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters