310 Commits

Author SHA1 Message Date
pancake
18c9541216 Fix #10563 - Fix null deref in java 2018-07-02 13:02:59 +02:00
pancake
9d85d55b8d Fix #10561 - null deref in java 2018-07-02 12:56:07 +02:00
radare
e9ce0d64fa
Fix #10498 - Fix crash in fuzzed java files (#10511) 2018-06-27 13:56:59 +02:00
Riccardo Schirone
2df06bd870 Fix ELF issue with null SHT entries (#10449)
* format/elf: extract function to avoid duplicated code
* format/elf: use ut64 to avoid errors in ELF32

Otherwise, while analyzing ELF32, -1 will be interpreted as the unsigned
value 0xffffffff, which is very different from -1 (0xffffffffffffffff).

* format/elf: fix symbols with shndx == SHT_NULL

Symbols with shndx == SHT_NULL should not be listed as symbols but they
should be available when other ELF structures (imports, relocs, etc.)
reference them.

This patch adds those symbols in the symbols_by_ord table but not to the
list of available symbols. Imports/relocs/etc. work by indexing symbols
by symbol index, so they are going to use the symbols_by_ord table and
make everything work.

Moreover, it refactors a bit the relocs function to avoid duplicated
code.

* bin: setimportd/setsymbold should clone the import/symbol
* bin/bin.c: free fields only when sym is not NULL
* format/elf: do not filter out symbols with size == 0 and consider sht_null symbols in shdr too.
* bin/bin.c: create R_STR_DUP macro and use it in _clone functions
* format/elf: when parsing symbols from phdr, stop at first UNK type/bind
* create some R_BIN defines to handle strings related to TYPE and BIND
  in RBinSymbols
* format/elf: add a doc
2018-06-26 13:48:53 +02:00
pancake
c979417eda Fix crash in hbo_class.c-6638_1.class 2018-06-25 09:28:20 +02:00
pancake
a1d79aab1a Fix crash in fuzzed java hbo_class-6223_2.class 2018-06-25 09:28:20 +02:00
pancake
367a541ea8 Fix null deref in fuzzed java classname for npe_r_class.c-1576_1.class 2018-06-25 09:28:20 +02:00
pancake
69371fa6f9 Fix crash in hbo_class-6223_1.class 2018-06-25 09:28:20 +02:00
pancake
5ba902b95c No imports with spaces on Java, even on error 2018-06-20 16:26:58 +02:00
pancake
19f6cea471 Fix #10409 - heap oobread in java class 2018-06-20 16:14:01 +02:00
Paul I
7e9f982849 Meson: some cleanup (#10076) 2018-05-16 10:24:35 +02:00
Riccardo Schirone
170f80d1d7 Remove R_BIN_SCN_MAP flag (#9744) 2018-03-22 22:10:07 +01:00
Paul I
69e655fd49 Meson: enable Propeller and Java (#9639) 2018-03-09 20:05:47 +08:00
Giovanni
397d6b1211 Fixed shlr java warnings and thread regression warning (#9447) 2018-02-21 05:03:03 +01:00
Ziyaddin Sadigov
d4dd6fd5e6 Fix typo regarding byte size (#9067) 2017-12-27 18:33:58 +01:00
pancake
0b1e8eaecc Fix almost all warnings from the msvc build 2017-12-19 00:18:39 +01:00
pancake
702afebc66 Fix Windows build and a bunch of scary warnings 2017-11-06 03:23:21 +01:00
Giovanni
2740763886 Merging all cov fixes (#8377)
* 1356272 Resource leak
* 1356452,1356450 Resource leak
* flavour + strdup and fixed mistake
* 1361500 Resource leak
* 1360784 Resource leak
* 1367821 Resource leak
* removed missing allocated vars
2017-08-29 13:15:47 +02:00
alvarofe
bbca2d3dff Trap before in anal_java to avoid continue execution 2017-08-29 00:12:14 +02:00
Giovanni
52826ff3ef 7 more coverity bugs fixed (#8306)
* 1379842/1379836 Resource leak
* 1379834 Resource leak
* 1379742/1379747/1379748/1379749/1379750/1379747/1379760 Resource leak
* 1379752 Resource leak
* 1379751 Double free
* 1379743 Use after free
* 1379624 Uninitialized scalar variable
* 1379332 Out-of-bounds read
2017-08-26 13:08:53 +02:00
Giovanni
7b40f7aed1 16 more bugs fixed. most are mem leaks. (#8307)
* 1379261/1379262 Resource leak

* 1379258/1379249 Resource leak

* 1379020 Resource leak

* 1351565/1351564 Logically dead code, 1379019 Uninitialized scalar variable, 1379014 Operands do not affect result

* 1379017 Resource leak

* 1379016 Resource leak

* 1379015 Resource leak

* 1377414 Resource leak

* 1376336 Resource leak

* 1375800 Resource leak

* 1373505/1373509/1373504 Resource leak

* 1373496 Resource leak
2017-08-24 17:20:39 +02:00
pancake
62b45bce07 More build fixes for android 2017-08-19 20:05:21 +02:00
pancake
d68d1fda83 Fix crash regression in fuzzed CLASS binary 2017-08-19 19:10:28 +02:00
pancake
fd7dfad154 More fixes 2017-08-19 17:16:54 +02:00
pancake
2829d9e398 Detect kotlin in java classes 2017-07-19 13:55:05 +02:00
pancake
770f3e752f Fix #7932 - Support relative addresses in java assembler 2017-07-17 12:17:53 +02:00
pancake
87fe418092 Fix #7706 - Enhance the Java assembler 2017-06-24 19:58:48 +02:00
pancake
d6642b10dd Fix last covs 2017-05-29 21:50:57 +02:00
pancake
40b87865a8 Fix listing methods of classes in Java bins 2017-05-29 01:18:04 +02:00
Raúl Peñacoba
435ecdef66 class.c: add missing free to avoid a memleak (#7549) 2017-05-20 23:04:26 +02:00
SkUaTeR
7d7c9cb5a7 More fixes in shlr for MSVC 2017-05-16 20:14:39 +02:00
pancake
ad54e9ddf1 Refix mingw32 build 2017-05-10 00:34:05 +02:00
xarkes
926f024909 Improved MSVC support (WIP) 2017-05-09 14:25:57 +02:00
pancake
60f9667654 Remove support for bjam build system
- Delete all Jamroot files
2017-05-02 05:48:40 +02:00
pancake
16c73edfa5 Fix 3 null derefs and two overflows in java 2017-04-18 01:16:07 +02:00
pancake
a66cc10d46 Fix a huge list of null derefs from clang-analyzer 2017-04-17 22:02:04 +02:00
pancake
3081163a9e Fix two java crashes 2017-04-11 19:18:14 +02:00
pancake
6eff81c201 Those ones too 2017-03-13 03:53:27 +01:00
alvarofe
bc901a752a Fix some crashes in classes.c (java) 2017-03-12 22:08:22 +01:00
alvarofe
6874c11be2 r2-indent shlr/java/class.c 2017-03-09 00:00:09 +01:00
alvarofe
9ef422090d Fix oob read in java 2017-03-08 23:57:31 +01:00
pancake
2e758020d3 Two more fixes for emscripten 2017-01-19 23:55:16 +01:00
Marc
f78f2b2b16 add haddr for Java entrypoints (#6510) 2017-01-15 23:50:45 +01:00
pancake
ea5c83ce4e Fix a bunch of malloc(0) 2016-11-08 15:09:52 +01:00
pancake
be9df39f6f Fixed 40 null derefs reported by coverity 2016-10-20 15:02:25 +02:00
Álvaro Felipe Melchor
83dffe4e53 Fix oob read in java 2016-06-29 09:28:19 +02:00
pancake
7ff42b590f Fix build and bring back java memleak to avoid crash 2016-06-14 02:54:27 +02:00
pancake
93910d9ce0 Fix memleak in shlr/java 2016-06-14 02:04:26 +02:00
Álvaro Felipe Melchor
21d554846d fix mem leak java code 2016-06-09 18:27:55 +02:00
Álvaro Felipe Melchor
31c4c89e9f Fix #5071 & #5070 (#5084) 2016-06-08 13:14:36 +02:00