fudbugs 求助怎么修改

xiaobing395845388 2013-12-17 01:45:57
这个bug怎么修改啊?

package com.thunisoft.oa.common.utils;

import java.util.Properties;

import com.thunisoft.artery.module.config.PropertyPlaceholderConfigurerEx;
import com.thunisoft.summer.component.crypto.defaultDecrypt.DESedeDecryptor;

public class PropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurerEx {

private static DESedeDecryptor decryptor = new DESedeDecryptor();
protected String resolvePlaceholder(String placeholder, Properties props) {
String value = super.resolvePlaceholder(placeholder, props);
if (null != value) {
if (value.startsWith("ENCRYPT#")) {
value = decryptor.decrypt(value.substring("ENCRYPT#".length()));
}
}
return value;
}
}


Bug: com.thunisoft.oa.common.utils.PropertyPlaceholderConfigurer.<static initializer>() creates a com.thunisoft.summer.component.crypto.defaultDecrypt.DESedeDecryptor classloader, which should be performed within a doPrivileged block
Pattern id: DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED, type: DP, category: BAD_PRACTICE


This code creates a classloader, which requires a security manager. If this code will be granted security permissions, but might be invoked by code that does not have security permissions, then the classloader creation needs to occur inside a doPrivileged block.




...全文
67 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧