-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #11766 Fixes #11769 Fixes #11767 Fixes #11770 Change-Id: I441382af58f60deb46dcdd70076763b2c47738d4 Reviewed-on: https://go-review.googlesource.com/12378 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Dmitry Vyukov <dvyukov@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
- Loading branch information
Showing
2 changed files
with
45 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2015 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package trace | ||
|
||
import ( | ||
"strings" | ||
"testing" | ||
) | ||
|
||
func TestCorruptedInputs(t *testing.T) { | ||
// These inputs crashed parser previously. | ||
tests := []string{ | ||
"gotrace\x00\x020", | ||
"gotrace\x00Q00\x020", | ||
"gotrace\x00T00\x020", | ||
"gotrace\x00\xc3\x0200", | ||
} | ||
for _, data := range tests { | ||
events, err := Parse(strings.NewReader(data)) | ||
if err == nil || events != nil { | ||
t.Fatalf("no error on input: %q\n", t) | ||
} | ||
} | ||
} |