]> Cypherpunks repositories - gostls13.git/commit
cgo: restrict #cgo directives to prevent shell expansion
authorGustavo Niemeyer <gustavo@niemeyer.net>
Fri, 27 May 2011 11:46:51 +0000 (08:46 -0300)
committerGustavo Niemeyer <gustavo@niemeyer.net>
Fri, 27 May 2011 11:46:51 +0000 (08:46 -0300)
commita825e8a69f3811c55d9bbf988ef0cec667d5380c
treeb4e03b9018b722ec0a70b94465bf7924c1e06927
parenta1d2cbf6450871ad1b21f46f53c6b7a4e500e776
cgo: restrict #cgo directives to prevent shell expansion

Fixes issue #1879.

Directives were not directly expanded, but since their
content ended up in makefiles, further expansion would
take place there.  This prevents such artifacts by
restricting the set of characters that may be used in
a directive value.

To build the list of safe characters I went through the
contents of /usr/lib/pkgconfig and extracted LDFLAGS
and CFLAGS information, so hopefully this is a
reasonable default to get started.

R=rsc
CC=golang-dev
https://golang.org/cl/4532092
src/cmd/cgo/gcc.go