fix out-of-bounds write in r_anal_reflines_str

This commit is contained in:
Jonathan Neuschäfer 2014-06-25 02:22:32 +02:00 committed by pancake
parent e8ec0cf550
commit 4b59bc6181

View File

@ -227,8 +227,10 @@ R_API char* r_anal_reflines_str(void *core, ut64 addr, int opts) {
lw-=l;
memset (pfx, ' ', sizeof (pfx));
if (lw>=sizeof (pfx)) lw = sizeof (pfx);
pfx[lw - 1] = 0;
if (lw>0) str = r_str_prefix (str, pfx);
if (lw > 0) {
pfx[lw - 1] = 0;
str = r_str_prefix (str, pfx);
}
}
}
str = r_str_concat (str, (dir==1)? "-> "