Skip to content

[Question] <Java> Disallowed list has been tampered #2165

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

Open
yuluo-yx opened this issue Apr 20, 2025 · 4 comments
Open

[Question] <Java> Disallowed list has been tampered #2165

yuluo-yx opened this issue Apr 20, 2025 · 4 comments
Labels
question Further information is requested

Comments

@yuluo-yx
Copy link
Member

yuluo-yx commented Apr 20, 2025

Question

package indi.yuluo.fury;

import org.apache.fury.Fury;
import org.apache.fury.config.Language;

public class FuryExample {
	public static void main(String[] args) {

		User user = new User();
		user.setName("test");
		user.setAge(20);

		// 重复使用 Fury 对象
		Fury fury = Fury.builder().withLanguage(Language.JAVA)
				.requireClassRegistration(true)
				.build();

		// 注册类
		// fury.register(User.class);

		// 序列化
		byte[] bytes = fury.serialize(user);
		// System.out.println("序列化结果: " + Arrays.toString(bytes));

		// 输出反序列化结果
		User user1 = (User) fury.deserialize(bytes);
		System.out.println(user1);
	}
}

User.java

public class User {

	private String name;

	private Integer age;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}
}
<dependencies>
	<dependency>
		<groupId>org.apache.fury</groupId>
		<artifactId>fury-core</artifactId>
		<version>0.10.1</version>
	</dependency>
</dependencies>

是我那里的用法有问题吗?🤔

@yuluo-yx yuluo-yx added the question Further information is requested label Apr 20, 2025
@chaokunyang
Copy link
Collaborator

This bug is introduced in #2100 , it's fixed in #2128 , 0.10.2 and 0.11.+ will include this fix

@yuluo-yx
Copy link
Member Author

这里是因为 fury/disallowlist.txt 文件被篡改导致的吗?没有太看清楚这个问题怎么来的 🤔

@moooonk
Copy link
Contributor

moooonk commented Apr 22, 2025

是因为不同平台的换行符不一致导致的计算差异 @yuluo-yx

@yuluo-yx
Copy link
Member Author

是因为不同平台的换行符不一致导致的计算差异 @yuluo-yx

明白了,感谢 🫡

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

No branches or pull requests

3 participants