code
stringlengths
12
2.05k
label_name
stringlengths
6
8
label
int64
0
95
public static void serializeToStream(final OutputStream os, final Object payload) throws IOException { ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(os); oos.writeObject(payload); } finally { if (oos != null) { try { ...
CWE-502
15
public void testFileRegionCountLargerThenFile(ServerBootstrap sb, Bootstrap cb) throws Throwable { File file = File.createTempFile("netty-", ".tmp"); file.deleteOnExit(); final FileOutputStream out = new FileOutputStream(file); out.write(data); out.close(); sb.child...
CWE-378
80
public void setErrorHandler(ErrorHandler errorHandler) { this.errorHandler = errorHandler; }
CWE-611
13
public ModelAndView recover(HttpServletRequest request, HttpServletResponse response) throws Exception { Map<String, Object> map = new HashMap<String, Object>(); String usernameOrEmail = StringUtils.trimToNull(request.getParameter("usernameOrEmail")); if (usernameOrEmail != null) { ...
CWE-335
81
public static XStream createXStreamInstance() { return new EnhancedXStream(false); }
CWE-91
78
private void renderState(FacesContext context) throws IOException { // Get the view state and write it to the response.. PartialViewContext pvc = context.getPartialViewContext(); PartialResponseWriter writer = pvc.getPartialResponseWriter(); String viewStateId = Util.getViewStateId(c...
CWE-79
1
public void tearDown() throws Exception { if(embeddedServer != null) embeddedServer.extinguish(); }
CWE-22
2
void resetPasswordUnexistingUser() throws Exception { when(this.userReference.toString()).thenReturn("user:Foobar"); when(this.userManager.exists(this.userReference)).thenReturn(false); String exceptionMessage = "User [user:Foobar] doesn't exist"; when(this.localizationManager.ge...
CWE-640
20
setImmediate(() => { if (!this.pendingPublishRequestCount) { return; } const starving_subscription = this._find_starving_subscription(); if (starving_subscription) { doDebug && debugLog(chalk.bgWhite.red("feeding most late subscript...
CWE-770
37
private void sendAllJSON(HttpExchange pExchange, ParsedUri pParsedUri, JSONAware pJson) throws IOException { OutputStream out = null; try { Headers headers = pExchange.getResponseHeaders(); if (pJson != null) { headers.set("Content-Type", getMimeType(pParsedUr...
CWE-79
1
public void create() throws Exception { final JettyServerFactory jettyServerFactory = mock(JettyServerFactory.class); final StaticFilesConfiguration staticFilesConfiguration = mock(StaticFilesConfiguration.class); final Routes routes = mock(Routes.class); when(jettyServerFactory.cre...
CWE-22
2
private <T> Document marshallToDocument(JAXBElement<T> object, Class<T> type) throws SAMLException { try { JAXBContext context = JAXBContext.newInstance(type); Marshaller marshaller = context.createMarshaller(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setName...
CWE-611
13
public int decryptWithAd(byte[] ad, byte[] ciphertext, int ciphertextOffset, byte[] plaintext, int plaintextOffset, int length) throws ShortBufferException, BadPaddingException { int space; if (ciphertextOffset > ciphertext.length) space = 0; else space = ciphertext.length - ciphertextOffset; if (l...
CWE-125
47
public SAXReader(XMLReader xmlReader, boolean validating) { this.xmlReader = xmlReader; this.validating = validating; }
CWE-611
13
public CreateCommentResponse save(CreateCommentRequest createCommentRequest) { CreateCommentResponse createCommentResponse = new CreateCommentResponse(); if (createCommentRequest.getLogId() != null && createCommentRequest.getComment() != null) { if (isAllowComment(Integer.valueOf(createC...
CWE-79
1
public UPathHand(UPath source, Random rnd) { final UPath result = new UPath(); Point2D last = new Point2D.Double(); for (USegment segment : source) { final USegmentType type = segment.getSegmentType(); if (type == USegmentType.SEG_MOVETO) { final double x = segment.getCoord()[0]; final double y ...
CWE-918
16
public Operation.OperationResult executeFixedCostOperation( final MessageFrame frame, final EVM evm) { Bytes shiftAmount = frame.popStackItem(); final Bytes value = leftPad(frame.popStackItem()); final boolean negativeNumber = value.get(0) < 0; if (shiftAmount.size() > 4 && (shiftAmount = shift...
CWE-681
59
public final HColor getBackColor(ISkinParam skinParam, Style style) { if (colors == null || colors.getColor(ColorType.BACK) == null) { if (UseStyle.useBetaStyle() == false) return HColorUtils.COL_D7E0F2; return style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSe...
CWE-918
16
public void warning(SAXParseException e) { }
CWE-611
13
void ampersand() { final PathAndQuery res = PathAndQuery.parse("/&?a=1&a=2&b=3"); assertThat(res).isNotNull(); assertThat(res.path()).isEqualTo("/&"); assertThat(res.query()).isEqualTo("a=1&a=2&b=3"); // '%26' in a query string should never be decoded into '&'. final...
CWE-22
2
void checkVerificationCode() throws Exception { when(this.userManager.exists(this.userReference)).thenReturn(true); InternetAddress email = new InternetAddress("foobar@xwiki.org"); when(this.userProperties.getEmail()).thenReturn(email); String verificationCode = "abcd1245"; ...
CWE-640
20
static public UStroke getStrokeInternal(IGroup group, ISkinParam skinParam, Style style) { final Colors colors = group.getColors(); if (colors.getSpecificLineStroke() != null) return colors.getSpecificLineStroke(); if (style != null) return style.getStroke(); if (group.getUSymbol() != null && group.get...
CWE-918
16
public static void main(String[] args) throws LifecycleException { String webappDirLocation; if (Constants.IN_JAR) { webappDirLocation = "webapp"; } else { webappDirLocation = "src/main/webapp/"; } Tomcat tomcat = new Tomcat(); String webPort...
CWE-79
1
public AjaxResult updateAvatar(@RequestParam("avatarfile") MultipartFile file) { SysUser currentUser = getSysUser(); try { if (!file.isEmpty()) { String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file); cur...
CWE-79
1
public DefaultFileSystemResourceLoader(String path) { this.baseDirPath = Optional.of(Paths.get(normalize(path))); }
CWE-22
2
public FileSelection(UserRequest ureq, String currentContainerRelPath) { if (currentContainerRelPath.equals("/")) currentContainerRelPath = ""; this.currentContainerRelPath = currentContainerRelPath; parse(ureq); }
CWE-22
2
private String getTitleQTI12(QuestionItemImpl item) { try { VFSLeaf leaf = qpoolService.getRootLeaf(item); Item xmlItem = QTIEditHelper.readItemXml(leaf); return xmlItem.getTitle(); } catch (NullPointerException e) { log.warn("Cannot read files from dir: " + item.getDirectory()); } return null; }
CWE-91
78
public RoutingResultBuilder rawParam(String name, String value) { pathParams().put(requireNonNull(name, "name"), ArmeriaHttpUtil.decodePath(requireNonNull(value, "value"))); return this; }
CWE-22
2
void hexadecimal() { assertThat(PathAndQuery.parse("/%")).isNull(); assertThat(PathAndQuery.parse("/%0")).isNull(); assertThat(PathAndQuery.parse("/%0X")).isNull(); assertThat(PathAndQuery.parse("/%X0")).isNull(); }
CWE-22
2
private int _readAndWriteBytes(OutputStream out, int total) throws IOException { int left = total; while (left > 0) { int avail = _inputEnd - _inputPtr; if (_inputPtr >= _inputEnd) { loadMoreGuaranteed(); avail = _inputEnd - _inputPtr; ...
CWE-770
37
private void ensureInitialized() throws SQLException { if (!initialized) { throw new PSQLException( GT.tr( "This SQLXML object has not been initialized, so you cannot retrieve data from it."), PSQLState.OBJECT_NOT_IN_STATE); } // Is anyone loading data into us at t...
CWE-611
13
public void archive(OLATResourceable ores, File exportDirectory) { ObjectOutputStream out = null; try { File file = new File(exportDirectory, "chat.xml"); Writer writer = new FileWriter(file); out = logXStream.createObjectOutputStream(writer); int counter = 0; List<InstantMessage> messages; d...
CWE-91
78
protected final void _decodeNonStringName(int ch) throws IOException { final int type = ((ch >> 5) & 0x7); String name; if (type == CBORConstants.MAJOR_TYPE_INT_POS) { name = _numberToName(ch, false); } else if (type == CBORConstants.MAJOR_TYPE_INT_NEG) { ...
CWE-770
37
public void svgImage(UImageSvg image, double x, double y) { // https://developer.mozilla.org/fr/docs/Web/SVG/Element/image if (hidden == false) { final Element elt = (Element) document.createElement("image"); elt.setAttribute("width", format(image.getWidth())); elt.setAttribute("height", format(image.getH...
CWE-918
16
private NameID parseNameId(NameIDType element) { NameID nameId = new NameID(); nameId.format = NameIDFormat.fromSAMLFormat(element.getFormat()); nameId.id = element.getValue(); return nameId; }
CWE-611
13
public static String serializeToString(final Object payload) throws IOException { final ByteArrayOutputStream bos = new ByteArrayOutputStream(); serializeToStream(bos, payload); String agentData = null; try { agentData = bos.toString("8859_1"); } catch (Unsupporte...
CWE-502
15
private static void addMagic(SName sname) { final String cleanName = sname.name().replace("_", ""); addConvert(cleanName + "BackgroundColor", PName.BackGroundColor, sname); addConvert(cleanName + "BorderColor", PName.LineColor, sname); addConvert(cleanName + "BorderThickness", PName.LineThickness, sname); ad...
CWE-918
16
public Document read(InputStream in) throws DocumentException { InputSource source = new InputSource(in); if (this.encoding != null) { source.setEncoding(this.encoding); } return read(source); }
CWE-611
13
public void testGetChunk() throws Exception { TestHttpData test = new TestHttpData("test", UTF_8, 0); try { File tmpFile = File.createTempFile(UUID.randomUUID().toString(), ".tmp"); tmpFile.deleteOnExit(); FileOutputStream fos = new FileOutputStream(tmpFile); ...
CWE-378
80
private static void handleResponse(HttpURLConnection conn, int statusCode, String terminalWidth) { try { // 200 - modules found // Other - Error occurred, json returned with the error message MapValue payload; if (statusCode == HttpURLConnection.HTTP_OK) { ...
CWE-306
79
public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException { int space; if (ciphertextOffset > ciphertext.length) space = 0; else space = ciphertext.length - ciphertextOffset; if (!haskey) { // The key ...
CWE-787
24
private ModelAndView renameGroup(HttpServletRequest request, HttpServletResponse response) throws Exception { String oldName = request.getParameter("groupName"); String newName = request.getParameter("newName"); if (StringUtils.hasText(oldName) && StringUtils.hasText(newNam...
CWE-79
1
public int decryptWithAd(byte[] ad, byte[] ciphertext, int ciphertextOffset, byte[] plaintext, int plaintextOffset, int length) throws ShortBufferException, BadPaddingException { int space; if (ciphertextOffset > ciphertext.length) space = 0; else space = ciphertext.length - ciphertextOffset; if (l...
CWE-125
47
public void reportJobCaches(byte[] cacheInstanceBytes) { @SuppressWarnings("unchecked") Collection<CacheInstance> cacheInstances = (Collection<CacheInstance>) SerializationUtils .deserialize(cacheInstanceBytes); jobManager.reportJobCaches(getJobToken(), cacheInstances); }
CWE-502
15
public ErrorHandler getErrorHandler() { return errorHandler; }
CWE-611
13
public void setCharacterStream() throws Exception { String exmplar = "<x>value</x>"; SQLXML pgSQLXML = con.createSQLXML(); Writer writer = pgSQLXML.setCharacterStream(); writer.write(exmplar); PreparedStatement preparedStatement = con.prepareStatement("insert into xmltab values (?)"); prepare...
CWE-611
13
public PersistentTask createTask(String name, Serializable task, Identity creator, OLATResource resource, String resSubPath, Date scheduledDate) { PersistentTask ptask = new PersistentTask(); Date currentDate = new Date(); ptask.setCreationDate(currentDate); ptask.setLastModified(currentDate); ptask.setSc...
CWE-91
78
public void setDefaultHandler(ElementHandler handler) { getDispatchHandler().setDefaultHandler(handler); }
CWE-611
13
public static byte[] decryptAuthenticated(final SecretKey secretKey, final byte[] iv, final byte[] cipherText, final byte[] aad, final byte[] authTag, ...
CWE-354
82
public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(JavaScriptHeaderItem.forReference(new MarkdownResourceReference())); String encodedAttachmentSupport; if (getAttachmentSupport() != null) { encodedAttachmentSupport = Base64.encodeBase64String(SerializationUtil...
CWE-502
15
public PlayerBinary(String code, ISkinParam skinParam, TimingRuler ruler, boolean compact) { super(code, skinParam, ruler, compact); this.style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); this.suggestedHeight = 30; }
CWE-918
16
public Controller execute(FolderComponent fc, UserRequest ureq, WindowControl wContr, Translator trans) { this.translator = trans; this.folderComponent = fc; this.fileSelection = new FileSelection(ureq, fc.getCurrentContainerPath()); VFSContainer currentContainer = folderComponent.getCurrentContainer(); Lis...
CWE-22
2
protected void setDispatchHandler(DispatchHandler dispatchHandler) { this.dispatchHandler = dispatchHandler; }
CWE-611
13
private Certificate toCertificate(KeyDescriptorType keyDescriptorType) { try { List<Object> keyData = keyDescriptorType.getKeyInfo().getContent(); for (Object keyDatum : keyData) { if (keyDatum instanceof JAXBElement<?>) { JAXBElement<?> element = (JAXBElement<?>) keyDatum; ...
CWE-611
13
public static DomainSocketAddress newSocketAddress() { try { File file; do { file = File.createTempFile("NETTY", "UDS"); if (!file.delete()) { throw new IOException("failed to delete: " + file); } } while...
CWE-379
83
private ModelAndView renameGroup(HttpServletRequest request, HttpServletResponse response) throws Exception { String oldName = request.getParameter("groupName"); String newName = request.getParameter("newName"); if (StringUtils.hasText(oldName) && StringUtils.hasText(newNam...
CWE-79
1
public ResponseEntity<Resource> fetch(@PathVariable String key) { LitemallStorage litemallStorage = litemallStorageService.findByKey(key); if (key == null) { ResponseEntity.notFound(); } String type = litemallStorage.getType(); MediaType mediaType = MediaType.pars...
CWE-22
2
void getGadgets() throws Exception { assertEquals(new ArrayList<>(), this.defaultGadgetSource.getGadgets(testSource, macroTransformationContext)); BaseObject gadgetObject1 = mock(BaseObject.class); when(xWikiDocument.getXObjects(gadgetClassReference)).thenReturn(Collections.singletonLis...
CWE-94
14
private void testBSI() throws Exception { KeyPairGenerator kpGen = KeyPairGenerator.getInstance("ECDSA", "BC"); kpGen.initialize(new ECGenParameterSpec(TeleTrusTObjectIdentifiers.brainpoolP512r1.getId())); KeyPair kp = kpGen.generateKeyPair(); byte[] data = "Hello Worl...
CWE-347
25
private static void handleErrorResponse(HttpURLConnection conn, String url, String moduleFullName) { try (BufferedReader reader = new BufferedReader( new InputStreamReader(conn.getErrorStream(), Charset.defaultCharset()))) { StringBuilder result = new StringBuilder(); ...
CWE-306
79
public <T extends Result> T setResult(Class<T> resultClass) throws SQLException { try { if (isDebugEnabled()) { debugCode( "getSource(" + (resultClass != null ? resultClass.getSimpleName() + ".class" : "null") + ')'); } checkEditabl...
CWE-611
13
protected final void loadMoreGuaranteed() throws IOException { if (!loadMore()) { _reportInvalidEOF(); } }
CWE-770
37
public String toString() { return toNiceString(this.getClass(), "clientId", clientId, "secret", "[protected]", "discoveryURI", discoveryURI, "scope", scope, "customParams", customParams, "clientAuthenticationMethod", clientAuthenticationMethod, "useNonce", useNonce, "pref...
CWE-347
25
public Stream<URL> getResources(String path) { Enumeration<URL> all; try { all = classLoader.getResources(prefixPath(path)); } catch (IOException e) { return Stream.empty(); } Stream.Builder<URL> builder = Stream.builder(); while (all.hasMoreEl...
CWE-22
2
public void doFilter(ServletRequest srequest, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { /* HttpServletRequest request = (HttpServletRequest) srequest; //final String realIp = request.getHeader(X_FORWARDED_FOR); //if (realIp != null) { filterChain.doFil...
CWE-79
1
public void spliceToFile() throws Throwable { EventLoopGroup group = new EpollEventLoopGroup(1); File file = File.createTempFile("netty-splice", null); file.deleteOnExit(); SpliceHandler sh = new SpliceHandler(file); ServerBootstrap bs = new ServerBootstrap(); bs.cha...
CWE-379
83
public void doIconSize( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { String qs = req.getQueryString(); if(qs==null || !ICON_SIZE.matcher(qs).matches()) throw new ServletException(); Cookie cookie = new Cookie("iconSize", qs); cookie.set...
CWE-79
1
public static SecretKey deriveSharedKey(final JWEHeader header, final SecretKey Z, final ConcatKDF concatKDF) throws JOSEException { final int sharedKeyLength = sharedKeyLength(header.getAlgorithm(), header.getEncryptionMethod()); // Set the alg ID for the concat KDF AlgorithmMode algMode = resol...
CWE-347
25
public void testGetShellCommandLineBash_WithWorkingDirectory() throws Exception { Commandline cmd = new Commandline( new BourneShell() ); cmd.setExecutable( "/bin/echo" ); cmd.addArguments( new String[] { "hello world" } ); File root = File.listRoots()...
CWE-78
6
private <T> T unmarshallFromDocument(Document document, Class<T> type) throws SAMLException { try { JAXBContext context = JAXBContext.newInstance(type); Unmarshaller unmarshaller = context.createUnmarshaller(); JAXBElement<T> element = unmarshaller.unmarshal(document, type); return element...
CWE-611
13
private String deflateAndEncode(byte[] result) { Deflater deflater = new Deflater(Deflater.DEFLATED, true); deflater.setInput(result); deflater.finish(); byte[] deflatedResult = new byte[result.length]; int length = deflater.deflate(deflatedResult); deflater.end(); byte[] src = Arrays.copy...
CWE-611
13
public static UChange changeBack(UGraphic ug) { final HColor color = ug.getParam().getColor(); if (color == null) { return new HColorNone().bg(); } return color.bg(); }
CWE-918
16
public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof ClassPathResource) { ClassPathResource otherRes = (ClassPathResource) obj; ClassLoader thisLoader = this.classLoader; ClassLoader otherLoader = otherRes.c...
CWE-22
2
private String buildRedirectAuthnRequest(AuthnRequestType authnRequest, String relayState, boolean sign, PrivateKey key, Algorithm algorithm) throws SAMLException { try { byte[] xml = marshallToBytes(PROTOCOL_OBJECT_FACTORY.createAuthnRequest(authnRequest), AuthnRe...
CWE-611
13
private void visitorPermission(Invocation ai) { ai.invoke(); String templateName = ai.getReturnValue(); if (templateName == null) { return; } GlobalResourceHandler.printUserTime("Template before"); String templatePath = TemplateHelper.fullTemplateInfo(ai.g...
CWE-79
1
new X509TrustManager() { public java.security.cert.X509Certificate[] getAcceptedIssuers() { return new java.security.cert.X509Certificate[]{}; } public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) { ...
CWE-306
79
public <T extends Source> T getSource(Class<T> sourceClass) throws SQLException { try { if (isDebugEnabled()) { debugCode( "getSource(" + (sourceClass != null ? sourceClass.getSimpleName() + ".class" : "null") + ')'); } checkReadabl...
CWE-611
13
protected void initUpgradesHistories() { File upgradesDir = new File(WebappHelper.getUserDataRoot(), SYSTEM_DIR); File upgradesHistoriesFile = new File(upgradesDir, INSTALLED_UPGRADES_XML); if (upgradesHistoriesFile.exists()) { upgradesHistories = (Map<String, UpgradeHistoryData>)upgradesXStream.fromXML(upgra...
CWE-91
78
public InternetAddress getUserEmail() { return userEmail; }
CWE-640
20
private String getMimeType(HttpServletRequest pReq) { String requestMimeType = pReq.getParameter(ConfigKey.MIME_TYPE.getKeyValue()); if (requestMimeType != null) { return requestMimeType; } return configMimeType; }
CWE-79
1
public HomePageConfig loadConfigFor(Identity identity) { String userName = identity.getName(); HomePageConfig retVal = null; File configFile = getConfigFile(userName); if (!configFile.exists()) { // config file does not exist! create one, init the defaults, save it. retVal = loadAndSaveDefaults(identity)...
CWE-91
78
private static TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { public java.security.cert.X509Certificate[] getAcceptedIssuers() { return new java.security.cert.X509Certificate[] {}; } public void checkClientTrusted(java.security.cert.X509Certificate[...
CWE-306
79
public static int getStatusCode(HttpURLConnection conn) { try { return conn.getResponseCode(); } catch (IOException e) { throw ErrorUtil .createCommandException("connection to the remote repository host failed: " + e.getMessage()); } }
CWE-306
79
public ResponseEntity<Resource> download(@PathVariable String key) { LitemallStorage litemallStorage = litemallStorageService.findByKey(key); if (key == null) { ResponseEntity.notFound(); } String type = litemallStorage.getType(); MediaType mediaType = MediaType.p...
CWE-22
2
void routingResult() throws URISyntaxException { final RoutingResultBuilder builder = RoutingResult.builder(); final RoutingResult routingResult = builder.path("/foo") .query("bar=baz") .rawParam("q...
CWE-22
2
public CommandExecutionResult createRobustConcise(String code, String full, TimingStyle type, boolean compact) { final Player player = new PlayerRobustConcise(type, full, getSkinParam(), ruler, compactByDefault || compact); players.put(code, player); lastPlayer = player; return CommandExecutionResult.ok(); }
CWE-918
16
public BCXMSSMTPrivateKey(PrivateKeyInfo keyInfo) throws IOException { XMSSMTKeyParams keyParams = XMSSMTKeyParams.getInstance(keyInfo.getPrivateKeyAlgorithm().getParameters()); this.treeDigest = keyParams.getTreeDigest().getAlgorithm(); XMSSPrivateKey xmssMtPrivateKey = XMSSPri...
CWE-470
84
public AuthenticationInfo loadAuthenticationInfo(JSONWebToken token) { Key key = getJWTKey(); Jwt jwt; try { jwt = Jwts.parser().setSigningKey(key).parse(token.getPrincipal()); } catch (JwtException e) { throw new AuthenticationException(e); } ...
CWE-347
25
public static final void toStream(Binder binder, ZipOutputStream zout) throws IOException { try(OutputStream out=new ShieldOutputStream(zout)) { myStream.toXML(binder, out); } catch (Exception e) { log.error("Cannot export this map: " + binder, e); } }
CWE-91
78
public String getStringParameterSQL(String param) { return "'" + param + "'"; }
CWE-89
0
public Object getResourceDataForKey(String key) { Object data = null; String dataString = null; Matcher matcher = DATA_SEPARATOR_PATTERN.matcher(key); if (matcher.find()) { if (log.isDebugEnabled()) { log.debug(Messages.getMessage( Messages.RESTORE_DATA_FROM_RESOURCE_URI_INFO, key, d...
CWE-502
15
public static boolean isAbsolute(String url) { if (url.startsWith("//")) // //www.domain.com/start { return true; } if (url.startsWith("/")) // /somePage.html { return false; } boolean result = false; try { URI uri = new URI(url); result = uri.isAbsolute(); } catch (URISyntax...
CWE-918
16
public ChangeState(TimeTick when, String comment, Colors colors, String... states) { if (states.length == 0) { throw new IllegalArgumentException(); } this.when = when; this.states = states; this.comment = comment; this.colors = colors; }
CWE-918
16
public SymbolContext getContext(ISkinParam skinParam, Style style) { return new SymbolContext(getBackColor(skinParam, style), getLineColor(skinParam, style)) .withStroke(new UStroke(1.5)); }
CWE-918
16
public Controller execute(FolderComponent folderComponent, UserRequest ureq, WindowControl wControl, Translator trans) { setTranslator(trans); currentContainer = folderComponent.getCurrentContainer(); if (currentContainer.canWrite() != VFSConstants.YES) { throw new AssertException("Cannot write to current fol...
CWE-22
2
public PlayerRobustConcise(TimingStyle type, String full, ISkinParam skinParam, TimingRuler ruler, boolean compact) { super(full, skinParam, ruler, compact); this.type = type; this.suggestedHeight = 0; }
CWE-918
16
private <T> byte[] marshallToBytes(JAXBElement<T> object, Class<T> type) throws SAMLException { try { JAXBContext context = JAXBContext.newInstance(type); Marshaller marshaller = context.createMarshaller(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); marshaller.marshal(object...
CWE-611
13
public static String getRealIp(HttpServletRequest request) { //bae env if (ZrLogUtil.isBae() && request.getHeader("clientip") != null) { return request.getHeader("clientip"); } String ip = request.getHeader("X-forwarded-for"); if (ip == null || ip.length() == 0 ||...
CWE-79
1
public String[] getCommandline() { final String[] args = getArguments(); String executable = getExecutable(); if ( executable == null ) { return args; } final String[] result = new String[args.length + 1]; result[0] = executable; Syste...
CWE-78
6
public void testFileRegionCountLargerThenFile(ServerBootstrap sb, Bootstrap cb) throws Throwable { File file = File.createTempFile("netty-", ".tmp"); file.deleteOnExit(); final FileOutputStream out = new FileOutputStream(file); out.write(data); out.close(); sb.child...
CWE-379
83