Issue #10535 has been reported by Andy Maloney.

----------------------------------------
Bug #10535: Potential uninitialized reference pipe_open() in io.c
https://bugs.ruby-lang.org/issues/10535

* Author: Andy Maloney
* Status: Open
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* ruby -v: ruby 2.2.0dev (2014-11-22 trunk 48537) [x86_64-darwin12.0]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
(From git commit f5063b7ea7e774519602f7a112d9acf536a1da33 of 22 November 2014.)

In **io.c** in the following function:

~~~
static VALUE
pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convconfig)

~~~

IF !defined(HAVE_WORKING_FORK) and !defined(HAVE_SPAWNV), THEN argc and argv are declared. (lines 5938, 5939)

Unless I'm missing something in the #if #else #endif fiesta, they don't seem to be initialized anywhere.

Then in the #else case at line 6069, we have this:

~~~
#else
    if (argc) {
	prog = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" "));
	cmd = StringValueCStr(prog);
    }

~~~

Best case, the compiler initializes argc to 0, which means this is dead code.  Worst case, the compiler chooses not to initialize to 0, then *Bad Things* will happen.




-- 
https://bugs.ruby-lang.org/