Fix #16455 - iij asserts for ld-uclibc with a null import ##bin (#16509)

* Fix asserts in `iij` for ld-uclibc with a null import ##bin
* Add test for `iij` on ld-uclibc
This commit is contained in:
pancake 2020-04-10 06:00:30 +02:00 committed by GitHub
parent 388df51df2
commit af51074455
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 3 deletions

View File

@ -1849,13 +1849,16 @@ static int bin_imports(RCore *r, int mode, int va, const char *name) {
str = r_str_replace (str, "\"", "\\\"", 1);
pj_ki (pj, "ordinal", import->ordinal);
pj_ks (pj, "bind", import->bind);
pj_ks (pj, "type", import->type);
if (import->bind) {
pj_ks (pj, "bind", import->bind);
}
if (import->type) {
pj_ks (pj, "type", import->type);
}
if (import->classname && import->classname[0]) {
pj_ks (pj, "classname", import->classname);
pj_ks (pj, "descriptor", import->descriptor);
}
pj_ks (pj, "name", str);
if (libname) {
pj_ks (pj, "libname", libname);

View File

@ -13,3 +13,19 @@ EXPECT=<<EOF
EOF
RUN
NAME=ELF: ld-uclibc
FILE=../bins/elf/ld-uClibc-0.9.33.2.so
CMDS=<<EOF
ii
iij
EOF
EXPECT=<<EOF
[Imports]
nth vaddr bind type lib name
---------------------------------
0 0x00000000 NONE NONE
[{"ordinal":0,"name":"","plt":0}]
EOF
RUN