Skip to content

Commit

Permalink
l0gic's fix for an use after free in r_socket
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Aug 29, 2012
1 parent ef4217a commit 0a202fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion libr/socket/proc.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* radare - LGPL - Copyright 2007-2012 - pancake */

/* XXX : move to r_util??? rename method names.. to long? */
/* proc IO is not related to socket io.. this is shitty!! */

Expand Down Expand Up @@ -44,11 +46,12 @@ R_API struct r_socket_proc_t *r_socket_proc_open(char *const argv[]) {
dup2 (sp->fd1[1], 1);
execv (argv[0], argv);
exit (1);
break;
case -1:
perror ("fork");
r_socket_proc_close (sp);
free (sp);
break;
return NULL;
//r_socket_block_time (sp, R_FALSE, 0);
}
return sp;
Expand Down
2 changes: 1 addition & 1 deletion libr/socket/socket.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2006-2012 pancake<nopcode.org> */
/* radare - LGPL - Copyright 2006-2012 - pancake */

#include <errno.h>
#include <r_types.h>
Expand Down
2 changes: 1 addition & 1 deletion libr/util/str.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2007-2012 pancake<nopcode.org> */
/* radare - LGPL - Copyright 2007-2012 - pancake */

#include "r_types.h"
#include "r_util.h"
Expand Down

0 comments on commit 0a202fc

Please # to comment.