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

TypeAdapter(Factories) dont check passed (token) type #623

Open
cdietrich opened this issue May 17, 2022 · 0 comments
Open

TypeAdapter(Factories) dont check passed (token) type #623

cdietrich opened this issue May 17, 2022 · 0 comments

Comments

@cdietrich
Copy link
Contributor

our TypeAdapter(Factories) dont check if the (token) type passed into
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
matches the type the adapter is for.

when testing with

GsonBuilder builder = new GsonBuilder();
		builder.registerTypeAdapterFactory(new RestartArgumentsTypeAdapterFactory());
		Gson gson = builder.create();
		XXXX object = gson.fromJson("{\"noDebug\":true}", ELEMENT_TYPE.getType());

this may lead to stackoverflows

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

No branches or pull requests

1 participant