Skip to content

Commit

Permalink
memset options structure to prevent use of unset members
Browse files Browse the repository at this point in the history
  • Loading branch information
pquerna committed Jun 5, 2012
1 parent 2d205a9 commit 1cac962
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/luv_process.c
Expand Up @@ -16,6 +16,8 @@
*/

#include <stdlib.h>
#include <string.h>


#include "luv_process.h"
#include "luv_portability.h"
Expand Down Expand Up @@ -57,6 +59,8 @@ int luv_spawn(lua_State* L) {
luaL_checktype(L, 5, LUA_TTABLE); /* args */
luaL_checktype(L, 6, LUA_TTABLE); /* options */

memset(&options, 0, sizeof(uv_process_options_t));

/* Parse the args array */
argc = lua_objlen(L, 5) + 1;
args = malloc((argc + 1) * sizeof(char*));
Expand Down

0 comments on commit 1cac962

Please sign in to comment.