]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.20] 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)
committerGopher Robot <gobot@golang.org>
Tue, 6 Jun 2023 17:02:02 +0000 (17:02 +0000)
commitfa60c381ed06c12f9c27a7b50ca44c5f84f7f0f4
treeea4b7019a3dd1b1dcec3e3fd084b511554931fc4
parent36144ba429ef2650940c72e7a0b932af3612d420
[release-branch.go1.20] 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.

Updates #60306
Fixes #60514
Fixes CVE-2023-29405

Change-Id: I36b6e188a44c80d7b9573efa577c386770bd2ba3
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>
(cherry picked from commit bcdfcadd5612212089d958bc352a6f6c90742dcc)
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1902228
Run-TryBot: Roland Shoemaker <bracewell@google.com>
TryBot-Result: Security TryBots <security-trybots@go-security-trybots.iam.gserviceaccount.com>
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1904345
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/501220
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: David Chase <drchase@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
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]