The attached patch will fix the issue without breaking any existing use
case. Can someone please review. If looks good I will push the patch to
its proper place.

HH. ppm

Description: Patch for fixing _write on invalid objects
Origin: vendor
Bug-Debian: http://bugs.debian.org/746804
Author: Partha Pratim Mukherjee <ppm.fl...@gmail.com>
--- a/lib/IPC/Run.pm
+++ b/lib/IPC/Run.pm
@@ -2465,8 +2465,14 @@ sub _open_pipes {
             }
             _debug_desc_fd( 'writing to', $pipe ) if _debugging_details;
 
-            my $c = _write( $pipe->{FD}, $$in_ref );
-            substr( $$in_ref, 0, $c, '' );
+           if (length $$in_ref && $$in_ref) {
+               my $c = _write( $pipe->{FD}, $$in_ref );
+               substr( $$in_ref, 0, $c, '' );
+           } else {
+               $self->_clobber( $pipe );
+               return undef;
+           }
+
             return 1;
          };
          ## Output filters are the first filters

Reply via email to