Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protoparse: panic in (*basicCompositeNode).start #334

Closed
johanbrandhorst opened this issue Jul 6, 2020 · 1 comment · Fixed by #337
Closed

protoparse: panic in (*basicCompositeNode).start #334

johanbrandhorst opened this issue Jul 6, 2020 · 1 comment · Fixed by #337

Comments

@johanbrandhorst
Copy link
Contributor

johanbrandhorst commented Jul 6, 2020

Hi!

I tried fuzzing 1.7.0 with the help of @bradleyjkemp's excellent fuzzing method from #271 and ran into a pretty interesting panic. It is reproduced by using a file with a single 0. This reproduces the panic:

package main

import (
	"fmt"
	"io"
	"io/ioutil"
	"strings"

	"github.com/jhump/protoreflect/desc/protoparse"
)

func main() {
	parser := &protoparse.Parser{
		Accessor: func(_ string) (closer io.ReadCloser, e error) {
			return ioutil.NopCloser(strings.NewReader("0")), nil
		},
	}

	_, err := parser.ParseFiles("foo")
	if err != nil {
		fmt.Println("Error!", err)
	}
	fmt.Println("Success!")
}

I'd like to take this moment to re-state the case for continuous fuzzing of protoparse. It's a prime example of a library that will benefit from it, since it fundamentally works on arbitrary user-supplied bytes. As already mentioned by Bradley, there are platforms that provide free fuzzing for open source projects, and it'd be great to integrate it with protoreflect.

@bufdev
Copy link
Contributor

bufdev commented Jul 13, 2020

bufbuild/buf#107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants