Commit Graph

8 Commits

Author SHA1 Message Date
Rot127
3a2cd3c331
Coverity defects (#2469)
* Fix CID 508418 - Uninitialized struct

* Fix CID 509089 - Fix OOB read and write

* Fix CID 509088 - OOB.

Also adds tests and to ensure no OOB access.

* Fix CID 509085 - Resource leak.

* Fix CID 508414 and companions - Using undefined values.

* Fix CID 508405 - Use of uninitialized value

* Remove unnecessary and badly implemented dev fuzz code.

* Fix CID 508396 - Uninitialzied variable.

* Fix CID 508393, 508365 -- OOB read.

* Fix CID 432207 - OVerlapping memory access.

* Remove unused functions

* Fix CID 432170 - Overlapping memory access.

* Fix CID 166022 - Check for negative index

* Let strncat not depend n src operand.

* Fix 509083 and 509084 - NULL dereference

* Remove duplicated code.

* Initialize sysop

* Fix resource leak

* Remove unreachable code.

* Remove duplicate code.

* Add assert to check return value of cmoack

* Fixed: d should be a signed value, since it is checked against < 0

* Add missing break.

* Add NULL check

* Fix signs of binary search comparisons.

* Add explicit cast of or result

* Fix correct scope of case.

* Handle invalid integer type.

* Return UINT_MAX instead of implicitly casted -1

* Remove dead code

* Fix type of im

* Fix type of d

* Remove duplicated code.

* Add returns after CS_ASSERTS

* Check for len == 0 case.

* Ensure shift operates on uint64

* Replace strcpy with strncpy.

* Handle edge cases for 32bit rotate

* Fix some out of enum warnings

* Replace a strcpy with strncpy.

* Fix increment of address

* Skip some linting

* Fix: set instruction id

* Remove unused enum

* Replace the last usages of strcpy with SStream functions.

* Increase number of allowed AArch64 operands.

* Check safety of incrementing t the next operand.

* Fix naming of operand

* Update python constants

* Fix option setup of CS_OPT_DETAIL_REAL

* Document DETAIL_REAL has to be used with CS_OPT_ON.

* Run Coverity scan every Monday.

* Remove dead code

* Fix OOB read

* Rename macro to reflect it is only used with sstreams

* Fix rebase issues
2024-09-18 21:19:42 +08:00
Rot127
0a67596f70
Add test with ASAN enabled. (#2313)
* Add test with ASAN enabled.

* Fix leaks in cstool and cs.c

* Add work around so ASAN binaries don't DEADSIGNAL due to too many randomized address bits.

* Add ASAN build arguments to cstest

* Fix leaks in cstest

* Use cstest binary build by the main build.

* Add clonging step for cmocka when cstest is build

* Skip Python tests for ASAN

* Remove make build from CI

* Fix leaks in cstest.

- Rewrite split to remove leaks and improve runtime by 6%
- Add free()

* Fix cmocka external project to stable branch.

* Revert "Fix leaks in cstest."

This reverts commit bf8ee125b0c58f9c794eb081a69c80f8a71825cd.

* Fix memleaks in cstest

* Document adding of ASAN job to release guide

* Add CAPSTONE_BUILD_CSTEST to build docs

* Fix double free

* Add more detail tests to CI and fix them

* Initialize variables

* Fix typo

* Update cstest build docs

* Revert "Remove make build from CI"

This reverts commit 84f7360c6da6183cd41bec0fef3e1d0a2ee49ddf.

* Make cstest only run for cmake builds.

* Add cstest job for make build.

* Add CAPSTONE_DIET build test.

* Compile the compatibility header test with ASAN if enabled.

* Fix DIET build by excluding not used code.

* Missing "

* Build static library with ASAN and DIET if enabled.

* Revert "Add CAPSTONE_DIET build test."

This reverts commit 71e1469dee.
2024-06-10 10:01:00 +08:00
Rot127
5f11d3c1fe
Typo and tree-sitter init fix (#2358) 2024-05-16 20:31:44 +08:00
RainRat
b91c727481
fix typos (#2344) 2024-04-30 10:37:53 +08:00
Rot127
6c7b54817f
Add a clang-tidy checks and warnings (#2312) 2024-04-26 15:11:46 +08:00
R3v0LT
a5cf15e556
HPPA dissassembler fix unitialized variables errors (#2309) 2024-04-10 13:49:43 +08:00
R3v0LT
cda40c6537
Fix invalid comparison with HPPA_OP_INVALID (#2300) 2024-03-29 16:46:00 +08:00
R3v0LT
9daa1ffbac
Add HPPA(PA-RISC) architecture (#2265)
* Refactor HPPA

* Add full HPPA 1.1 instructions support

* Add HPPA 1.1 cs tests

* Fix HPPA dissassembler

* Add HPPA 2.0 instructions

* Add HPPA tests

* Fix HPPA disasm & printer

* Update HPPA tests

* Remove unused code

* Add implicit register access info & Refactor HPPA main files

* Add python bindings/tests and cstests

* Fix HPPA disasm wrong decoding

* Rewrite invalid test cases

* Update HPPA python constants

* Make HPPA python test executable

* Change HPPA python tests sequence to match c tests

* Refactor HPPA main files

* Write target instead of offset in details

* Add HPPA detail function support in cstest

* Rewrite targets in branch tests

* Make correct string modifier addition

* Add hppa test calls

* Add zero operands check

* Remove MCOperand array

* Change immediate values printing

* Add HPPA 2.0 wide support

* Fix invalid break instruction decode

Remove unused code

* Add HPPA to fuzzing tests

* Add HPPA to options

* Add HPPA to docs

* Refactor HPPA

* Fix invalid branch insn decoding

* Add HPPA to labeler

* clang-format hppa files

* Document internal structures and minor refactoring

* Add missing default statements

* Fix invalid default statement
2024-03-26 13:58:56 +08:00