code
stringlengths
23
2.05k
label_name
stringlengths
6
7
label
int64
0
37
public UploadFileResponse getCloudUrl(String contextPath, String uri, String finalFilePath, HttpServletRequest request) { UploadFileResponse uploadFileResponse = new UploadFileResponse(); // try push to cloud Map<String, String[]> map = new HashMap<>(); map.put("fileInfo", new String...
CWE-863
11
public void translate(ServerWindowItemsPacket packet, GeyserSession session) { Inventory inventory = InventoryUtils.getInventory(session, packet.getWindowId()); if (inventory == null) return; inventory.setStateId(packet.getStateId()); for (int i = 0; i < packet.getItems...
CWE-287
4
public void setUp(@TempDir Path tempDir) throws IOException { serverRepo = TempDirUtils.createTempDirectoryIn(tempDir, "testHgServerRepo").toFile(); clientRepo = TempDirUtils.createTempDirectoryIn(tempDir, "testHgClientRepo").toFile(); secondBranchWorkingCopy = TempDirUtils.createTempDirec...
CWE-77
14
public void testDirectContextUsage() throws Exception { assertThat(ConstraintViolations.format(validator.validate(new DirectContextExample()))) .containsExactlyInAnyOrder(FAILED_RESULT); assertThat(TestLoggerFactory.getAllLoggingEvents()) .isEmpty(); }
CWE-74
1
public void testPseudoHeadersWithRemovePreservesPseudoIterationOrder() { final HttpHeadersBase headers = newHttp2Headers(); final HttpHeadersBase nonPseudoHeaders = newEmptyHeaders(); for (Map.Entry<AsciiString, String> entry : headers) { if (entry.getKey().isEmpty() || ...
CWE-74
1
public static final String getRevision() { return "a"; }
CWE-200
10
public void testOfCharSequence() { // Should produce a lower-cased AsciiString. assertThat((Object) HttpHeaderNames.of("Foo")).isEqualTo(AsciiString.of("foo")); // Should reuse known header name instances. assertThat((Object) HttpHeaderNames.of("date")).isSameAs(HttpHeaderNames.DATE...
CWE-74
1
protected int getExpectedErrors() { return hasJavaNetURLPermission ? 2 : 1; // Security error must be reported as an error. Java 8 reports two errors. }
CWE-862
8
public void translate(RiderJumpPacket packet, GeyserSession session) { Entity vehicle = session.getRidingVehicleEntity(); if (vehicle instanceof AbstractHorseEntity) { ClientPlayerStatePacket playerStatePacket = new ClientPlayerStatePacket((int) vehicle.getEntityId(), PlayerState.START_...
CWE-287
4
default Optional<String> findFirst(CharSequence name) { return getFirst(name, String.class); }
CWE-400
2
public void existingDocumentFromUITemplateProviderSpecifiedButOldSpaceTypeButOverridenFromUIToTerminal() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocume...
CWE-862
8
public void translate(SetLocalPlayerAsInitializedPacket packet, GeyserSession session) { if (session.getPlayerEntity().getGeyserId() == packet.getRuntimeEntityId()) { if (!session.getUpstream().isInitialized()) { session.getUpstream().setInitialized(true); session...
CWE-287
4
public void translate(LoginPluginRequestPacket packet, GeyserSession session) { // A vanilla client doesn't know any PluginMessage in the Login state, so we don't know any either. // Note: Fabric Networking API v1 will not let the client log in without sending this session.sendDownstreamPack...
CWE-287
4
public static String getPropertyDef(InputSpec inputSpec, Map<String, Integer> indexes, String pattern, DefaultValueProvider defaultValueProvider) { int index = indexes.get(inputSpec.getName()); StringBuffer buffer = new StringBuffer(); inputSpec.appendField(buffer, index, "String"); inputSpec.appendCommonA...
CWE-74
1
public void multipleValuesPerNameIteratorEmpty() { final HttpHeadersBase headers = newEmptyHeaders(); assertThat(headers.valueIterator("name")).isExhausted(); assertThatThrownBy(() -> headers.valueIterator("name").next()) .isInstanceOf(NoSuchElementException.class); }
CWE-74
1
private boolean pull(ConsoleOutputStreamConsumer outputStreamConsumer) { CommandLine hg = hg("pull", "-b", branch, "--config", String.format("paths.default=%s", url)); return execute(hg, outputStreamConsumer) == 0; }
CWE-77
14
protected void traceLdapEnv(Properties env) { if (trace) { Properties tmp = new Properties(); tmp.putAll(env); String credentials = tmp.getProperty(Context.SECURITY_CREDENTIALS); String bindCredential = tmp.getProperty(BIND_CREDENTIAL); if (credentials != n...
CWE-200
10
public void newDocumentWebHomeFromURL() throws Exception { // new document = xwiki:X.Y.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("X", "Y"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); when(document.getDocumentRe...
CWE-862
8
protected String escape(String string) { String escaped = JavaEscape.escapeJava(string); // escape $ character since it has special meaning in groovy string escaped = escaped.replace("$", "\\$"); return escaped; }
CWE-74
1
public void translate(ServerEntityAttachPacket packet, GeyserSession session) { Entity holderId; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { holderId = session.getPlayerEntity(); } else { holderId = session.getEntityCache().getEntityByJavaI...
CWE-287
4
public void translate(ItemFrameDropItemPacket packet, GeyserSession session) { Entity entity = ItemFrameEntity.getItemFrameEntity(session, packet.getBlockPosition()); if (entity != null) { ClientPlayerInteractEntityPacket interactPacket = new ClientPlayerInteractEntityPacket((int) entity...
CWE-287
4
public static AsciiString of(CharSequence name) { if (name instanceof AsciiString) { return of((AsciiString) name); } final String lowerCased = Ascii.toLowerCase(requireNonNull(name, "name")); final AsciiString cached = map.get(lowerCased); return cached != null ...
CWE-74
1
List<Modification> findRecentModifications(int count) { // Currently impossible to check modifications on a remote repository. InMemoryStreamConsumer consumer = inMemoryConsumer(); bombUnless(pull(consumer), "Failed to run hg pull command: " + consumer.getAllOutput()); CommandLine hg...
CWE-77
14
public void translate(ServerPlayerHealthPacket packet, GeyserSession session) { SessionPlayerEntity entity = session.getPlayerEntity(); int health = (int) Math.ceil(packet.getHealth()); SetHealthPacket setHealthPacket = new SetHealthPacket(); setHealthPacket.setHealth(health); ...
CWE-287
4
public void existingDocumentTerminalFromUI() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); when(document.getDo...
CWE-862
8
public void translate(ServerEntityVelocityPacket packet, GeyserSession session) { Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId()); if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); } ...
CWE-287
4
public void authorizeRequest(Operation op) { op.complete(); }
CWE-732
13
private static void verifyPeerName(PGStream stream, Properties info, SSLSocket newConnection) throws PSQLException { HostnameVerifier hvn; String sslhostnameverifier = PGProperty.SSL_HOSTNAME_VERIFIER.get(info); if (sslhostnameverifier == null) { hvn = PGjdbcHostnameVerifier.INSTANCE; ss...
CWE-665
32
public void existingDocumentFromUIDeprecatedCheckEscaping() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); when...
CWE-862
8
public void switchToConversation(Conversation conversation, String text) { switchToConversation(conversation, text, false, null, false); }
CWE-200
10
protected final String constructValidationUrl(final String ticket, final String serviceUrl) { final Map<String, String> urlParameters = new HashMap<String, String>(); logger.debug("Placing URL parameters in map."); urlParameters.put("ticket", ticket); urlParameters.put("service", en...
CWE-74
1
public void newDocumentWebHomeFromURLTemplateProviderSpecifiedButNotAllowed() throws Exception { // new document = xwiki:X.Y.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("X", "Y"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class...
CWE-862
8
public static Map<String, String> genHeaderMapByRequest(HttpServletRequest request) { Map<String, String> map = new HashMap<>(); AdminTokenVO adminTokenVO = AdminTokenThreadLocal.getUser(); if (adminTokenVO != null) { User user = User.dao.findById(adminTokenVO.getUserId()); ...
CWE-863
11
public void save(String comment, boolean minorEdit) throws XWikiException { if (hasAccessLevel("edit")) { // If the current author does not have PR don't let it set current user as author of the saved document // since it can lead to right escalation if (hasProgrammin...
CWE-863
11
protected void afterFeaturesReceived() throws SecurityRequiredException, NotConnectedException, InterruptedException { StartTls startTlsFeature = getFeature(StartTls.ELEMENT, StartTls.NAMESPACE); if (startTlsFeature != null) { if (startTlsFeature.required() && config.getSecurityMode() ==...
CWE-362
18
public void giveWarningIfNoValidationMethods() throws Exception { assertThat(ConstraintViolations.format(validator.validate(new NoValidations()))) .isEmpty(); assertThat(TestLoggerFactory.getAllLoggingEvents()) .containsExactlyInAnyOrder( new LoggingEvent( ...
CWE-74
1
public void init(KeyGenerationParameters param) { this.param = (RSAKeyGenerationParameters)param; this.iterations = getNumberOfIterations(this.param.getStrength(), this.param.getCertainty()); }
CWE-327
3
public Optional<CorsOriginConfiguration> convert(Object object, Class<CorsOriginConfiguration> targetType, ConversionContext context) { CorsOriginConfiguration configuration = new CorsOriginConfiguration(); if (object instanceof Map) { Map mapConfig = (Map) object; Convertibl...
CWE-400
2
public void translate(ServerSpawnExpOrbPacket packet, GeyserSession session) { Vector3f position = Vector3f.from(packet.getX(), packet.getY(), packet.getZ()); Entity entity = new ExpOrbEntity( packet.getExp(), packet.getEntityId(), session.getEntityCache().getNextEntityId().incremen...
CWE-287
4
public void multipleValuesPerNameIterator() { final HttpHeadersBase headers = newEmptyHeaders(); headers.add("name1", "value1"); headers.add("name1", "value2"); assertThat(headers.size()).isEqualTo(2); final List<String> values = ImmutableList.copyOf(headers.valueIterator("n...
CWE-74
1
void validSaveNewTranslation() throws Exception { when(mockForm.getLanguage()).thenReturn("fr"); when(mockClonedDocument.getTranslatedDocument("fr", this.context)).thenReturn(mockClonedDocument); when(mockClonedDocument.getDocumentReference()).thenReturn(new DocumentReference("xwiki", "M...
CWE-862
8
public void translate(ServerUnloadChunkPacket packet, GeyserSession session) { session.getChunkCache().removeChunk(packet.getX(), packet.getZ()); //Checks if a skull is in an unloaded chunk then removes it Iterator<Vector3i> iterator = session.getSkullCache().keySet().iterator(); wh...
CWE-287
4
public void translate(ServerEntityPositionRotationPacket packet, GeyserSession session) { Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId()); if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); }...
CWE-287
4
protected void deactivateConversationContext(HttpServletRequest request) { ConversationContext conversationContext = httpConversationContext(); if (conversationContext.isActive()) { // Only deactivate the context if one is already active, otherwise we get Exceptions if (conve...
CWE-362
18
public Group createDefaultReadGroup(Context context, Collection collection, String typeOfGroupString, int defaultRead) throws SQLException, AuthorizeException { Group role = groupService.create(context); groupService.setName(role, "COLLECTION_" + colle...
CWE-863
11
public boolean isValid(Integer value, ConstraintValidatorContext context) { if (proxyManager.get(value) != null) { return true; } String errorMessage = String.format("No proxy server found for specified port %d", value); LOG.warn(errorMessage); context.buildConstraintViolatio...
CWE-74
1
public void headersWithSameNamesAndValuesShouldBeEquivalent() { final HttpHeadersBase headers1 = newEmptyHeaders(); headers1.add("name1", "value1"); headers1.add("name2", "value2"); headers1.add("name2", "value3"); final HttpHeadersBase headers2 = newEmptyHeaders(); ...
CWE-74
1
public AbstractEpsgFactory(final Hints userHints) throws FactoryException { super(MAXIMUM_PRIORITY - 20); // The following hints have no effect on this class behaviour, // but tell to the user what this factory do about axis order. hints.put(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Bo...
CWE-20
0
public boolean isValid(Object value, ConstraintValidatorContext context) { if (value != null && StringUtils.isNotEmpty(String.valueOf(value))) { return true; } String errorMessage = String.format("Expected not empty value, got '%s'", value); LOG.warn(errorMessage); context.bui...
CWE-74
1
protected void runTeardown() { Assert.assertTrue("Error during initialization", messagedInitialization); Assert.assertTrue("HTTP connection is not allowed", messagedAccessDenied); }
CWE-862
8
protected void initOther() throws ServletException { PropertyUtils.addBeanIntrospector( SuppressPropertiesBeanIntrospector.SUPPRESS_CLASS); PropertyUtils.clearDescriptors(); String value = null; value = getServletConfig().getInitParameter("config"); if (value...
CWE-20
0
public void shouldThrowExceptionIfUpdateFails() throws Exception { InMemoryStreamConsumer output = ProcessOutputStreamConsumer.inMemoryConsumer(); // delete repository in order to fail the hg pull command assertThat(FileUtils.deleteQuietly(serverRepo), is(true)); //...
CWE-77
14
public void translate(ServerDifficultyPacket packet, GeyserSession session) { SetDifficultyPacket setDifficultyPacket = new SetDifficultyPacket(); setDifficultyPacket.setDifficulty(packet.getDifficulty().ordinal()); session.sendUpstreamPacket(setDifficultyPacket); session.getWorldCa...
CWE-287
4
public void translate(PacketViolationWarningPacket packet, GeyserSession session) { // Not translated since this is something that the developers need to know session.getConnector().getLogger().error("Packet violation warning sent from client! " + packet.toString()); }
CWE-287
4
protected void parseModuleConfigFile(Digester digester, String path) throws UnavailableException { InputStream input = null; try { URL url = getServletContext().getResource(path); // If the config isn't in the servlet context, try the class loader // whi...
CWE-20
0
private File doDownload(String driverFileUrl, String filePath) { Path path = Path.of(filePath); // create parent directory if (Files.notExists(path)) { path.getParent().toFile().mkdirs(); try { Files.createFile(path); } catch (IOException ...
CWE-20
0
private void populateAuthCacheInAllPeers(AuthorizationContext authContext) throws Throwable { // send a GET request to the ExampleService factory to populate auth cache on each peer. // since factory is not OWNER_SELECTION service, request goes to the specified node. for (VerificationHost p...
CWE-732
13
public Argument<CompletableFuture> argumentType() { return Argument.of(CompletableFuture.class); }
CWE-400
2
private Secret(String value) { this.value = value; }
CWE-326
9
public int size() { return ByteUtils.bitLength(n.decode()); }
CWE-345
22
void validSave() throws Exception { when(mockClonedDocument.getRCSVersion()).thenReturn(new Version("1.2")); when(mockClonedDocument.getComment()).thenReturn("My Changes"); when(mockClonedDocument.getLock(this.context)).thenReturn(mock(XWikiLock.class)); when(mockForm.getTemplate...
CWE-862
8
public static Object instantiate(String classname, Properties info, boolean tryString, @Nullable String stringarg) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetExceptio...
CWE-665
32
public void translate(CommandRequestPacket packet, GeyserSession session) { String command = packet.getCommand().replace("/", ""); CommandManager commandManager = GeyserConnector.getInstance().getCommandManager(); if (session.getConnector().getPlatformType() == PlatformType.STANDALONE && com...
CWE-287
4
public void newDocumentWebHomeFromURLTemplateProviderSpecifiedButOldPageType() throws Exception { // new document = xwiki:X.Y.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("X", "Y"), "WebHome"); XWikiDocument document = mock(XWikiDocument.clas...
CWE-862
8
public void complexExample() throws Exception { assertThat(ConstraintViolations.format(validator.validate(new ComplexExample()))) .containsExactlyInAnyOrder( FAILED_RESULT + "1", FAILED_RESULT + "2", FAILED_RESULT + "3" ); asser...
CWE-74
1
public void translate(ServerUnlockRecipesPacket packet, GeyserSession session) { if (packet.getAction() == UnlockRecipesAction.REMOVE) { session.getUnlockedRecipes().removeAll(Arrays.asList(packet.getRecipes())); } else { session.getUnlockedRecipes().addAll(Arrays.asList(pack...
CWE-287
4
public static OHttpSessionManager getInstance() { return instance; }
CWE-200
10
public void existingDocumentTerminalFromUICheckEscaping() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); when(d...
CWE-862
8
protected boolean isProbablePrime(BigInteger x, int iterations) { /* * Primes class for FIPS 186-4 C.3 primality checking */ return !Primes.hasAnySmallFactors(x) && Primes.isMRProbablePrime(x, param.getRandom(), iterations); }
CWE-327
3
public void existingDocumentFromUITemplateProviderSpecifiedNonTerminal() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class);...
CWE-862
8
public void translate(ServerSpawnPlayerPacket packet, GeyserSession session) { Vector3f position = Vector3f.from(packet.getX(), packet.getY(), packet.getZ()); Vector3f rotation = Vector3f.from(packet.getYaw(), packet.getPitch(), packet.getYaw()); PlayerEntity entity; if (packet.getU...
CWE-287
4
public AuthorizationCodeRequestUrl newAuthorizationUrl() { return new AuthorizationCodeRequestUrl(authorizationServerEncodedUrl, clientId).setScopes( scopes); }
CWE-863
11
public void translate(NetworkStackLatencyPacket packet, GeyserSession session) { long pingId; // so apparently, as of 1.16.200 // PS4 divides the network stack latency timestamp FOR US!!! // WTF if (session.getClientData().getDeviceOs().equals(DeviceOs.PS4)) { pin...
CWE-287
4
public void invalidExample() throws Exception { assertThat(ConstraintViolations.format(validator.validate(new InvalidExample()))) .isEmpty(); assertThat(TestLoggerFactory.getAllLoggingEvents()) .containsExactlyInAnyOrder( new LoggingEvent( ...
CWE-74
1
private String tryRewrite(String s) throws IOException, InvalidKeyException { if (s.length()<24) return s; // Encrypting "" in Secret produces 24-letter characters, so this must be the minimum length if (!isBase64(s)) return s; // decode throws IOException if the input is...
CWE-326
9
public void nullHeaderNameNotAllowed() { newEmptyHeaders().add(null, "foo"); }
CWE-74
1
public void newDocumentWebHomeFromURLTemplateProviderSpecifiedTerminal() throws Exception { // new document = xwiki:X.Y.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("X", "Y"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); ...
CWE-862
8
public void existingDocumentFromUICheckEscaping() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); when(document....
CWE-862
8
public IdImpl(String id) { this.id = id; }
CWE-74
1
final void setObject(CharSequence name, Object... values) { final AsciiString normalizedName = normalizeName(name); requireNonNull(values, "values"); final int h = normalizedName.hashCode(); final int i = index(h); remove0(h, i, normalizedName); for (Object v: value...
CWE-74
1
private X509HostnameVerifier createHostNameVerifier() { X509HostnameVerifier verifier = new X509HostnameVerifier() { /** * {@InheritDoc} * * @see org.apache.http.conn.ssl.X509HostnameVerifier#verify(java.lang.String, javax.net.ssl.SSLSocket) */ public void verify(String ho...
CWE-346
16
public void existingDocumentFromUITemplateProviderSpecifiedRestrictionExistsOnParentSpace() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XW...
CWE-862
8
public void update(DatabaseTypeUpdateRequest request) { databaseTypeDao.selectOptionalById(request.getId()).ifPresent(data -> { if (DatabaseTypes.has(data.getDatabaseType())) { throw DomainErrors.MUST_NOT_MODIFY_SYSTEM_DEFAULT_DATABASE_TYPE.exception(); } ...
CWE-20
0
public void translate(ServerSettingsRequestPacket packet, GeyserSession session) { CustomForm window = SettingsUtils.buildForm(session); int windowId = session.getFormCache().addForm(window); // Fixes https://bugs.mojang.com/browse/MCPE-94012 because of the delay session.getConnecto...
CWE-287
4
public SecretRewriter() throws GeneralSecurityException { cipher = Secret.getCipher("AES"); key = Secret.getLegacyKey(); }
CWE-326
9
public void shouldGetLatestModifications() throws Exception { List<Modification> actual = hgCommand.latestOneModificationAsModifications(); assertThat(actual.size(), is(1)); final Modification modification = actual.get(0); assertThat(modification.getComment(), is("test")); as...
CWE-77
14
public void existingDocumentFromUITemplateProviderSpecified() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); wh...
CWE-862
8
public boolean isAvailable() { try { GeoTools.getInitialContext(); return true; } catch (NamingException e) { return false; } }
CWE-20
0
public void translate(ServerSpawnParticlePacket packet, GeyserSession session) { Function<Vector3f, BedrockPacket> particleCreateFunction = createParticle(session, packet.getParticle()); if (particleCreateFunction != null) { if (packet.getAmount() == 0) { // 0 means don't...
CWE-287
4
public void setUp() throws Exception { context = oldcore.getXWikiContext(); Utils.setComponentManager(oldcore.getMocker()); QueryManager mockSecureQueryManager = oldcore.getMocker().registerMockComponent((Type) QueryManager.class, "secure"); mockTemplateProvidersQu...
CWE-862
8
public OHttpSession[] getSessions() { acquireSharedLock(); try { return (OHttpSession[]) sessions.values().toArray(new OHttpSession[sessions.size()]); } finally { releaseSharedLock(); } }
CWE-200
10
public int getExpirationTime() { return expirationTime; }
CWE-200
10
public void translate(ItemStackRequestPacket packet, GeyserSession session) { Inventory inventory = session.getOpenInventory(); if (inventory == null) return; InventoryTranslator translator = session.getInventoryTranslator(); translator.translateRequests(session, invento...
CWE-287
4
public static SSLSocketFactory getSslSocketFactory(Properties info) throws PSQLException { String classname = PGProperty.SSL_FACTORY.get(info); if (classname == null || "org.postgresql.ssl.jdbc4.LibPQFactory".equals(classname) || "org.postgresql.ssl.LibPQFactory".equals(classname)) { ret...
CWE-665
32
public void handle(HttpServletRequest request, final HttpServletResponse response) throws Exception { // We're sending an XML response, so set the response content type to text/xml response.setContentType("text/xml"); // Parse the incoming request as XML SAXReader xmlReader = new SAXReader();...
CWE-200
10
public <T> List<T> search(String filter, Object[] filterArgs, Mapper<T> mapper, int maxResult) { List<T> results = new ArrayList<>(); DirContext dirContext = getDirContext(ldapConfiguration, ldapConfiguration.getManagerDn(), ldapConfiguration.getPassword()); try { List<SearchRes...
CWE-74
1
public static SocketFactory getSocketFactory(Properties info) throws PSQLException { // Socket factory String socketFactoryClassName = PGProperty.SOCKET_FACTORY.get(info); if (socketFactoryClassName == null) { return SocketFactory.getDefault(); } try { return (SocketFactory) ObjectFact...
CWE-665
32
public void privateMsgInMuc(Conversation conversation, String nick) { switchToConversation(conversation, null, false, nick, true); }
CWE-200
10
public DefaultArgument(Class<T> type, String name, AnnotationMetadata annotationMetadata, Argument... genericTypes) { this.type = type; this.name = name; this.annotationMetadata = annotationMetadata != null ? annotationMetadata : AnnotationMetadata.EMPTY_METADATA; this.typeParameters...
CWE-400
2
public void translate(ServerAdvancementsPacket packet, GeyserSession session) { AdvancementsCache advancementsCache = session.getAdvancementsCache(); if (packet.isReset()) { advancementsCache.getStoredAdvancements().clear(); advancementsCache.getStoredAdvancementProgress().cl...
CWE-287
4