Fix double-free in canvas.c (#15379)

This commit is contained in:
GustavoLCR 2019-10-29 06:24:09 -03:00 committed by radare
parent 6ad8b49b6c
commit 5da7f2476c

View File

@ -425,7 +425,7 @@ R_API void r_cons_canvas_print(RConsCanvas *c) {
}
R_API int r_cons_canvas_resize(RConsCanvas *c, int w, int h) {
if (!c || w < 0) {
if (!c || w < 0 || h <= 0) {
return false;
}
int *newblen = realloc (c->blen, sizeof *c->blen * h);