Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
8e3559c3
Commit
8e3559c3
authored
Jul 15, 2015
by
Chris Bednarski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Guard against uninitialized pointers in io.Copy to fix #2416
parent
c614bb70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
communicator/winrm/communicator.go
communicator/winrm/communicator.go
+7
-2
No files found.
communicator/winrm/communicator.go
View file @
8e3559c3
...
@@ -85,8 +85,13 @@ func (c *Communicator) Start(rc *packer.RemoteCmd) error {
...
@@ -85,8 +85,13 @@ func (c *Communicator) Start(rc *packer.RemoteCmd) error {
func
runCommand
(
shell
*
winrm
.
Shell
,
cmd
*
winrm
.
Command
,
rc
*
packer
.
RemoteCmd
)
{
func
runCommand
(
shell
*
winrm
.
Shell
,
cmd
*
winrm
.
Command
,
rc
*
packer
.
RemoteCmd
)
{
defer
shell
.
Close
()
defer
shell
.
Close
()
go
io
.
Copy
(
rc
.
Stdout
,
cmd
.
Stdout
)
if
rc
.
Stdout
!=
nil
&&
cmd
.
Stdout
!=
nil
{
go
io
.
Copy
(
rc
.
Stderr
,
cmd
.
Stderr
)
go
io
.
Copy
(
rc
.
Stdout
,
cmd
.
Stdout
)
}
if
rc
.
Stderr
!=
nil
&&
cmd
.
Stderr
!=
nil
{
go
io
.
Copy
(
rc
.
Stderr
,
cmd
.
Stderr
)
}
cmd
.
Wait
()
cmd
.
Wait
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment