l0gic's fix for an use after free in r_socket

This commit is contained in:
pancake 2012-08-30 00:47:16 +02:00
parent ef4217a87c
commit 0a202fc91a
3 changed files with 6 additions and 3 deletions

View File

@ -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!! */
@ -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;

View File

@ -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>

View File

@ -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"