]> Cypherpunks repositories - gostls13.git/commit
cmd/go,cmd/cgo: in _cgo_flags use one line per flag
authorIan Lance Taylor <iant@golang.org>
Thu, 4 May 2023 21:06:39 +0000 (14:06 -0700)
committerDavid Chase <drchase@google.com>
Tue, 6 Jun 2023 20:21:31 +0000 (20:21 +0000)
commit6d8af00a630aa51134e54f0f321658621c6410f0
tree6653378563dfc919813c1af96c9068e4c40419b4
parent0ddd067be6b9a76680a22d97765827e1e98c5ca9
cmd/go,cmd/cgo: in _cgo_flags use one line per flag

The flags that we recorded in _cgo_flags did not use any quoting,
so a flag containing embedded spaces was mishandled.
Change the _cgo_flags format to put each flag on a separate line.
That is a simple format that does not require any quoting.

As far as I can tell only cmd/go uses _cgo_flags, and it is only
used for gccgo. If this patch doesn't cause any trouble, then
in the next release we can change to only using _cgo_flags for gccgo.

Thanks to Juho Nurminen of Mattermost for reporting this issue.

Fixes #60306
Fixes CVE-2023-29405

Change-Id: I81fb5337db8a22e1f4daca22ceff4b79b96d0b4f
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1875094
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Roland Shoemaker <bracewell@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/501224
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/cgo/out.go
src/cmd/go/internal/work/gccgo.go
src/cmd/go/testdata/script/gccgo_link_ldflags.txt [new file with mode: 0644]