mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-27 08:12:44 +00:00
Fix oob read in prefixline and oob write in r_cons_canvas_write
This commit is contained in:
parent
8b7d699303
commit
19c48e7edb
@ -96,11 +96,13 @@ static int get_piece (const char *p, char *chr) {
|
||||
}
|
||||
|
||||
static char *prefixline(RConsCanvas *c, int *left) {
|
||||
int x;
|
||||
int x, len;
|
||||
char *p;
|
||||
if (!c) return NULL;
|
||||
if (strlen (c->b) < (c->y * c->w)) return NULL;
|
||||
p = c->b + (c->y * c->w);
|
||||
for (x = 0; p[x] && x<c->x; x++) {
|
||||
len = strlen(p)-1;
|
||||
for (x = 0; (p[x] && x<c->x) && x < len; x++) {
|
||||
if (p[x] == '\n')
|
||||
p[x] = ' ';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user