diff options
| author | van Hauser <vh@thc.org> | 2023-09-11 07:38:45 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-11 07:38:45 +0000 |
| commit | 0688c779ec543c4f5f84363b06c72ac11a14f716 (patch) | |
| tree | d8a48ed4ef6484918f3832c61af60af81f5d5392 /frida_mode/src | |
| parent | 11a622c63d70c9ca16c9847418b88992139aa892 (diff) | |
| parent | 5f6c76e192bcfde6abcf9d4156bfbb87d5480e23 (diff) | |
| download | afl++-0688c779ec543c4f5f84363b06c72ac11a14f716.tar.gz | |
Merge pull request #1857 from AFLplusplus/dev
push to stable
Diffstat (limited to 'frida_mode/src')
| -rw-r--r-- | frida_mode/src/instrument/instrument_arm64.c | 14 | ||||
| -rw-r--r-- | frida_mode/src/lib/lib.c | 6 |
2 files changed, 9 insertions, 11 deletions
diff --git a/frida_mode/src/instrument/instrument_arm64.c b/frida_mode/src/instrument/instrument_arm64.c index a0c66697..1147275f 100644 --- a/frida_mode/src/instrument/instrument_arm64.c +++ b/frida_mode/src/instrument/instrument_arm64.c @@ -402,17 +402,13 @@ bool instrument_write_inline(GumArm64Writer *cw, GumAddress code_addr, } - /* - * The mov instruction supports up to a 16-bit offset. If our offset is out of - * range, then it can end up clobbering the op-code portion of the instruction - * rather than just the operands. So return false and fall back to the + /* + * The mov instruction supports up to a 16-bit offset. If our offset is out of + * range, then it can end up clobbering the op-code portion of the instruction + * rather than just the operands. So return false and fall back to the * alternative instrumentation. */ - if (area_offset > UINT16_MAX) { - - return false; - - } + if (area_offset > UINT16_MAX) { return false; } code.code.mov_x0_curr_loc |= area_offset << 5; diff --git a/frida_mode/src/lib/lib.c b/frida_mode/src/lib/lib.c index d563b69b..7fac755a 100644 --- a/frida_mode/src/lib/lib.c +++ b/frida_mode/src/lib/lib.c @@ -44,8 +44,10 @@ static gboolean lib_find_exe(const GumModuleDetails *details, lib_details_t *lib_details = (lib_details_t *)user_data; - memcpy(lib_details->name, details->name, PATH_MAX); - memcpy(lib_details->path, details->path, PATH_MAX); + strncpy(lib_details->name, details->name, PATH_MAX); + strncpy(lib_details->path, details->path, PATH_MAX); + lib_details->name[PATH_MAX] = '\0'; + lib_details->path[PATH_MAX] = '\0'; lib_details->base_address = details->range->base_address; lib_details->size = details->range->size; return FALSE; |
