mirror of
https://github.com/radareorg/radare2.git
synced 2024-10-10 20:34:24 +00:00
* Fix segfault related to dwarf
This commit is contained in:
parent
e6e0421ad9
commit
08cfc25e85
@ -162,7 +162,7 @@ R_API char *r_file_slurp_random_line(const char *file) {
|
||||
R_API char *r_file_slurp_line(const char *file, int line, int context) {
|
||||
int i, lines = 0;
|
||||
int sz;
|
||||
char *ptr, *str = r_file_slurp (file, &sz);
|
||||
char *ptr = NULL, *str = r_file_slurp (file, &sz);
|
||||
// TODO: Implement context
|
||||
if (str) {
|
||||
for (i=0;str[i];i++)
|
||||
|
@ -97,7 +97,7 @@ R_API char *r_sys_cmd_str_full(const char *cmd, const char *input, int *len, cha
|
||||
pipe(sh_in);
|
||||
pipe(sh_out);
|
||||
pipe(sh_err);
|
||||
*len = 0;
|
||||
if (len) *len = 0;
|
||||
|
||||
int pid = fork();
|
||||
if (!pid) {
|
||||
@ -136,7 +136,7 @@ R_API char *r_sys_cmd_str_full(const char *cmd, const char *input, int *len, cha
|
||||
break;
|
||||
if (FD_ISSET (sh_out[0], &rfds)) {
|
||||
if ((bytes = read (sh_out[0], buffer, sizeof (buffer)-1)) == 0) break;
|
||||
*len += bytes;
|
||||
if (len) *len += bytes;
|
||||
output = r_str_concat (output, buffer);
|
||||
} else if (FD_ISSET (sh_err[0], &rfds) && sterr) {
|
||||
if (read (sh_err[0], buffer, sizeof (buffer)-1) == 0) break;
|
||||
|
Loading…
Reference in New Issue
Block a user