Fix null ptr deref

This commit is contained in:
pancake 2013-08-29 18:04:31 +02:00
parent 353ecec16c
commit f1e42d9448
2 changed files with 3 additions and 3 deletions

View File

@ -136,8 +136,8 @@ R_API int r_anal_fcn(RAnal *anal, RAnalFunction *fcn, ut64 addr, ut8 *buf, ut64
fcn->addr = addr;
fcn->type = (reftype==R_ANAL_REF_TYPE_CODE)?
R_ANAL_FCN_TYPE_LOC: R_ANAL_FCN_TYPE_FCN;
if (len>16)
len -= 16; // XXX: hack to avoid buffer overflow by reading >64 bytes..
//if (len>16)
// len -= 16; // XXX: hack to avoid buffer overflow by reading >64 bytes..
while (idx < len) {
r_anal_op_fini (&op);

View File

@ -84,7 +84,7 @@ R_API int r_meta_del(RMeta *m, int type, ut64 from, ut64 size, const char *str)
r_list_foreach_safe (m->data, iter, iter_tmp, d) {
if (d->type == type || type == R_META_TYPE_ANY) {
if (str != NULL && !strstr (d->str, str))
if (str && d->str && !strstr (d->str, str))
continue;
if (size==UT64_MAX || (from+size >= d->from && from <= d->to+size)) {
free (d->str);