Fix CID 1295065, 1362999

This commit is contained in:
Anton Kochkov 2016-12-17 01:11:54 +03:00
parent 37f1756139
commit df413fef42
2 changed files with 4 additions and 3 deletions

View File

@ -443,11 +443,12 @@ R_API char* r_anal_reflines_str(void *_core, ut64 addr, int opts) {
}
add_spaces (b, 0, pos, wide);
str = r_buf_free_to_string (b);
b = NULL;
if (!str) {
r_list_free (lvls);
//r_buf_free_to_string already free b and if that is the case
//b will be NULL and r_buf_free will return but if there was
//an error we free b here
//b will be NULL and r_buf_free will return but if there was
//an error we free b here
r_buf_free (b);
return NULL;
}

View File

@ -103,7 +103,7 @@ r_regex_error(int errcode, const RRegex *preg, char *errbuf, size_t errbuf_size)
len = strlen(s) + 1;
if (errbuf_size > 0) {
STRLCPY(errbuf, s, errbuf_size);
STRLCPY(errbuf, s, errbuf_size - 1);
}
return(len);