diff options
| author | Ian Lance Taylor <iant@golang.org> | 2014-01-21 06:12:54 -0800 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2014-01-21 06:12:54 -0800 |
| commit | 6111dc4e71ffd843ac8029df4fd67d32689f8e36 (patch) | |
| tree | c9dee14995ba8a7fcb9a4d711ef1814e707cc7f8 /src/liblink | |
| parent | cb133c66073303b08e893d6b71faf98bda2402e9 (diff) | |
| download | go-6111dc4e71ffd843ac8029df4fd67d32689f8e36.tar.xz | |
liblink: check for symgrow size too large
Many calls to symgrow pass a vlong value. Change the function
to not implicitly truncate, and to instead give an error if
the value is too large.
R=golang-codereviews, gobot, rsc
CC=golang-codereviews
https://golang.org/cl/54010043
Diffstat (limited to 'src/liblink')
| -rw-r--r-- | src/liblink/data.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/liblink/data.c b/src/liblink/data.c index 9a481b6e5e..58d6d6b5e8 100644 --- a/src/liblink/data.c +++ b/src/liblink/data.c @@ -41,10 +41,16 @@ mangle(char *file) } void -symgrow(Link *ctxt, LSym *s, int32 siz) +symgrow(Link *ctxt, LSym *s, vlong lsiz) { + int32 siz; + USED(ctxt); + siz = (int32)lsiz; + if((vlong)siz != lsiz) + sysfatal("symgrow size %lld too long", lsiz); + if(s->np >= siz) return; |
