Skip to content

Commit aa63a92

Browse files
lorenzo-stoakesrsc
authored andcommitted
gc: put limit on size of exported recursive interface
Prevents edge-case recursive types from consuming excessive memory. Fixes #1909. R=golang-dev, lvd, rsc CC=golang-dev https://golang.org/cl/5504108
1 parent 2cb6fcf commit aa63a92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/gc/fmt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,7 @@ Tconv(Fmt *fp)
14501450
if(t == T)
14511451
return fmtstrcpy(fp, "<T>");
14521452

1453-
if(t->trecur > 4)
1453+
if(t->trecur > 4 || fp->nfmt > 1000)
14541454
return fmtstrcpy(fp, "<...>");
14551455

14561456
t->trecur++;

0 commit comments

Comments
 (0)