提交 eafec1c0 authored 作者: Thomas Mueller's avatar Thomas Mueller

MathUtils.getSecureRandom could log a warning to System.err in case the…

MathUtils.getSecureRandom could log a warning to System.err in case the /dev/random is very slow, and the System.getProperties().toString() returned a string larger than 64 KB. 
上级 2ecef3a7
......@@ -133,7 +133,11 @@ public class MathUtils {
// environment
try {
out.writeUTF(System.getProperties().toString());
String s = System.getProperties().toString();
// can't use writeUTF, as the string
// might be larger than 64 KB
out.writeInt(s.length());
out.write(s.getBytes("UTF-8"));
} catch (Exception e) {
warn("generateAlternativeSeed", e);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论