fix CID 1297227, 1297226

This commit is contained in:
Judge_Dredd 2015-05-09 10:03:54 +03:00 committed by pancake
parent 9c30fbecba
commit fa57bfed27
2 changed files with 4 additions and 3 deletions

View File

@ -141,8 +141,8 @@ static int parse(RParse *p, const char *data, char *str) {
optr = ptr;
if (*ptr == '(') { ptr = strchr (ptr+1, ')'); }
if (*ptr == '[') { ptr = strchr (ptr+1, ']'); }
if (*ptr == '{') { ptr = strchr (ptr+1, '}'); }
if (ptr && *ptr == '[') { ptr = strchr (ptr+1, ']'); }
if (ptr && *ptr == '{') { ptr = strchr (ptr+1, '}'); }
if (!ptr) {
eprintf ("Unbalanced bracket\n");
return R_FALSE;

View File

@ -200,8 +200,9 @@ beach:
}
if (outbuf) {
free (out);
} else {
out[len] = 0;
}
out[len] =0;
return (int)len;
}