Skip to content

Commit

Permalink
Fix #18666 - uaf in python bin parser
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed May 7, 2021
1 parent a07dedb commit 5e16e2d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libr/bin/format/pyc/marshal.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* radare - LGPL3 - Copyright 2016-2020 - Matthieu (c0riolis) Tardy - l0stb1t*/
/* radare - LGPL3 - Copyright 2016-2021 - Matthieu (c0riolis) Tardy - l0stb1t*/

#include <r_io.h>
#include <r_bin.h>
Expand Down Expand Up @@ -88,9 +88,7 @@ static ut8 *get_bytes(RBuffer *buffer, ut32 size) {
}

static pyc_object *get_none_object(void) {
pyc_object *ret;

ret = R_NEW0 (pyc_object);
pyc_object *ret = R_NEW0 (pyc_object);
if (!ret) {
return NULL;
}
Expand Down Expand Up @@ -1137,7 +1135,9 @@ static pyc_object *get_object(RBuffer *buffer) {
}

if (flag && ref_idx) {
free_object (ref_idx->data);
if (ref_idx->data != ret) {
free_object (ref_idx->data);
}
ref_idx->data = copy_object (ret);
}
return ret;
Expand Down

0 comments on commit 5e16e2d

Please sign in to comment.