Fix UB in fcn_recurse (#17838)

```
fcn.c: In function 'fcn_recurse':
fcn.c:229:68: warning: 'omov_aop.disp' may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (o_reg_dst && reg_src && o_reg_dst->offset == reg_src->offset && omov_aop.disp != UT64_MAX) {
fcn.c:181:10: note: 'omov_aop.disp' was declared here
  RAnalOp omov_aop, mov_aop = { 0 };
          ^~~~~~~~
fcn.c:229:17: warning: 'reg_src' may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (o_reg_dst && reg_src && o_reg_dst->offset == reg_src->offset && omov_aop.disp != UT64_MAX) {
                 ^~
fcn.c:183:12: note: 'reg_src' was declared here
  RRegItem *reg_src, *o_reg_dst = NULL;
```

Co-authored-by: pancake <pancake@nopcode.org>
This commit is contained in:
pancake 2020-10-26 07:03:02 +01:00 committed by GitHub
parent dcd0f37817
commit cfb21c38e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,9 +178,10 @@ static bool is_delta_pointer_table(RAnal *anal, RAnalFunction *fcn, ut64 addr, u
/* check if current instruction is followed by an ujmp */
ut8 buf[JMPTBL_LEA_SEARCH_SZ];
RAnalOp *aop = jmp_aop;
RAnalOp omov_aop, mov_aop = { 0 };
RAnalOp omov_aop = {0};
RAnalOp mov_aop = {0};
RAnalOp add_aop = {0};
RRegItem *reg_src, *o_reg_dst = NULL;
RRegItem *reg_src = NULL, *o_reg_dst = NULL;
RAnalValue cur_scr, cur_dst = { 0 };
read_ahead (anal, addr, (ut8*)buf, sizeof (buf));
bool isValid = false;