code stringlengths 23 2.05k | label_name stringlengths 6 7 | label int64 0 37 |
|---|---|---|
public void translate(ServerChatPacket packet, GeyserSession session) {
TextPacket textPacket = new TextPacket();
textPacket.setPlatformChatId("");
textPacket.setSourceName("");
textPacket.setXuid(session.getAuthData().getXboxUUID());
switch (packet.getType()) {
c... | CWE-287 | 4 |
public void testHeaderNameNormalization() {
final HttpHeadersBase headers = newHttp2Headers();
headers.add("Foo", "bar");
assertThat(headers.getAll("foo")).containsExactly("bar");
assertThat(headers.getAll("fOO")).containsExactly("bar");
assertThat(headers.names()).contains(H... | CWE-74 | 1 |
public void testGetOperations() {
final HttpHeadersBase headers = newEmptyHeaders();
headers.add("Foo", "1");
headers.add("Foo", "2");
assertThat(headers.get("Foo")).isEqualTo("1");
final List<String> values = headers.getAll("Foo");
assertThat(values).containsExactl... | CWE-74 | 1 |
protected int getExpectedErrors() {
return hasJavaNetURLPermission ? 3 : 2; // Security error must be reported as an error
} | CWE-862 | 8 |
public void notExistingDocumentFromUIButNameTooLong() throws Exception
{
// current document = xwiki:Main.WebHome
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome");
XWikiDocument document = mock(XWikiDocument.class);
when(docum... | CWE-862 | 8 |
protected BigInteger chooseRandomPrime(int bitlength, BigInteger e, BigInteger sqrdBound)
{
for (int i = 0; i != 5 * bitlength; i++)
{
BigInteger p = new BigInteger(bitlength, 1, param.getRandom());
if (p.mod(e).equals(ONE))
{
continue;
... | CWE-327 | 3 |
public void newDocumentFromURLTemplateProviderSpecifiedButNotAllowed() throws Exception
{
// new document = xwiki:X.Y
DocumentReference documentReference =
new DocumentReference("Y", new SpaceReference("X", new WikiReference("xwiki")));
XWikiDocument document = mock(XWikiDocu... | CWE-862 | 8 |
public void translate(ServerClearTitlesPacket packet, GeyserSession session) {
SetTitlePacket titlePacket = new SetTitlePacket();
// TODO handle packet.isResetTimes()
titlePacket.setType(SetTitlePacket.Type.CLEAR);
titlePacket.setText("");
titlePacket.setXuid("");
tit... | CWE-287 | 4 |
public static SecretKey decryptCEK(final PrivateKey priv,
final byte[] encryptedCEK,
final int keyLength,
final Provider provider)
throws JOSEException {
try {
Cipher cipher = CipherHelper.getInstance("RSA/ECB/PKCS1Padding",... | CWE-345 | 22 |
public void delete(String databaseType) {
Path path = Paths.get(driverFilePath(driverBaseDirectory, databaseType));
try {
Files.deleteIfExists(path);
} catch (IOException e) {
log.error("delete driver error " + databaseType, e);
}
} | CWE-20 | 0 |
public static File createTempFile(String prefix, String suffix, File directory) throws IOException {
if (javaVersion() >= 7) {
if (directory == null) {
return Files.createTempFile(prefix, suffix).toFile();
}
return Files.createTempFile(directory.toPath(), ... | CWE-668 | 7 |
public void translate(ServerEntityTeleportPacket packet, GeyserSession session) {
Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId());
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
entity = session.getPlayerEntity();
}
... | CWE-287 | 4 |
private static CharSequenceMap toLowercaseMap(Iterator<? extends CharSequence> valuesIter,
int arraySizeHint) {
final CharSequenceMap result = new CharSequenceMap(arraySizeHint);
while (valuesIter.hasNext()) {
final AsciiString lowerCase... | CWE-74 | 1 |
public void translate(EntityEventPacket packet, GeyserSession session) {
switch (packet.getType()) {
case EATING_ITEM:
// Resend the packet so we get the eating sounds
session.sendUpstreamPacket(packet);
return;
case COMPLETE_TRADE:
... | CWE-287 | 4 |
public void existingDocumentFromUI() throws Exception
{
// current document = xwiki:Main.WebHome
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome");
XWikiDocument document = mock(XWikiDocument.class);
when(document.getDocumentRe... | CWE-862 | 8 |
public void appendText(String text) {
if (text == null) {
return;
}
String previous = this.binding.textinput.getText().toString();
if (UIHelper.isLastLineQuote(previous)) {
text = '\n' + text;
} else if (previous.length() != 0 && !Character.isWhitespac... | CWE-200 | 10 |
default Optional<MediaType> contentType() {
return getFirst(HttpHeaders.CONTENT_TYPE, MediaType.class);
} | CWE-400 | 2 |
public void subClassExample() throws Exception {
assertThat(ConstraintViolations.format(validator.validate(new SubclassExample())))
.containsExactlyInAnyOrder(
FAILED_RESULT,
FAILED_RESULT+"subclass"
);
assertThat(TestLoggerFactory.getA... | CWE-74 | 1 |
public void translate(ServerOpenWindowPacket packet, GeyserSession session) {
if (packet.getWindowId() == 0) {
return;
}
InventoryTranslator newTranslator = InventoryTranslator.INVENTORY_TRANSLATORS.get(packet.getType());
Inventory openInventory = session.getOpenInventor... | CWE-287 | 4 |
protected final void populateUrlAttributeMap(final Map<String, String> urlParameters) {
urlParameters.put("pgtUrl", encodeUrl(this.proxyCallbackUrl));
} | CWE-74 | 1 |
public void highlightInMuc(Conversation conversation, String nick) {
switchToConversation(conversation, null, false, nick, false);
} | CWE-200 | 10 |
private X509TrustManager createTrustManager() {
X509TrustManager trustManager = new X509TrustManager() {
/**
* {@InheritDoc}
*
* @see javax.net.ssl.X509TrustManager#checkClientTrusted(java.security.cert.X509Certificate[], java.lang.String)
*/
public void checkClientTrusted... | CWE-346 | 16 |
public void translate(ServerPlaySoundPacket packet, GeyserSession session) {
String packetSound;
if (packet.getSound() instanceof BuiltinSound) {
packetSound = ((BuiltinSound) packet.getSound()).getName();
} else if (packet.getSound() instanceof CustomSound) {
packetS... | CWE-287 | 4 |
void setConfigAttributes_shouldUpdatePasswordWhenPasswordChangedBooleanChanged() throws Exception {
P4MaterialConfig materialConfig = p4("", "");
materialConfig.setPassword("notSecret");
Map<String, String> map = new HashMap<>();
map.put(P4MaterialConfig.PASSWORD, "secret");
... | CWE-77 | 14 |
public List<Modification> modificationsSince(Revision revision) {
InMemoryStreamConsumer consumer = inMemoryConsumer();
bombUnless(pull(consumer), "Failed to run hg pull command: " + consumer.getAllOutput());
CommandLine hg = hg("log",
"-r", "tip:" + revision.getRevision(),
... | CWE-77 | 14 |
public void checkConnection(UrlArgument repositoryURL) {
execute(createCommandLine("hg").withArgs("id", "--id").withArg(repositoryURL).withNonArgSecrets(secrets).withEncoding("utf-8"), new NamedProcessTag(repositoryURL.forDisplay()));
} | CWE-77 | 14 |
public static <T> T throw0(Throwable throwable) {
if (throwable == null) throw new NullPointerException();
getUnsafe().throwException(throwable);
throw new RuntimeException();
} | CWE-200 | 10 |
public User getUser() {
return user;
} | CWE-200 | 10 |
public void iterateEmptyHeadersShouldThrow() {
final Iterator<Map.Entry<AsciiString, String>> iterator = newEmptyHeaders().iterator();
assertThat(iterator.hasNext()).isFalse();
iterator.next();
} | CWE-74 | 1 |
final void set(CharSequence name, String... values) {
final AsciiString normalizedName = normalizeName(name);
requireNonNull(values, "values");
final int h = normalizedName.hashCode();
final int i = index(h);
remove0(h, i, normalizedName);
for (String v : values) {
... | CWE-74 | 1 |
public void testNotThrowWhenConvertFails() {
final HttpHeadersBase headers = newEmptyHeaders();
headers.set("name1", "");
assertThat(headers.getInt("name1")).isNull();
assertThat(headers.getInt("name1", 1)).isEqualTo(1);
assertThat(headers.getDouble("name")).isNull();
... | CWE-74 | 1 |
private static void checkCEKLength(final SecretKey cek, final EncryptionMethod enc)
throws KeyLengthException {
if (enc.cekBitLength() != ByteUtils.bitLength(cek.getEncoded())) {
throw new KeyLengthException("The Content Encryption Key (CEK) length for " + enc + " must be " + enc.cekBitLength() + " bits");
}... | CWE-345 | 22 |
public void emptyHeadersShouldBeEqual() {
final HttpHeadersBase headers1 = newEmptyHeaders();
final HttpHeadersBase headers2 = newEmptyHeaders();
assertThat(headers2).isEqualTo(headers1);
assertThat(headers2.hashCode()).isEqualTo(headers1.hashCode());
} | CWE-74 | 1 |
public void translate(ServerEntityRemoveEffectPacket packet, GeyserSession session) {
Entity entity;
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
entity = session.getPlayerEntity();
session.getEffectCache().removeEffect(packet.getEffect());
}... | CWE-287 | 4 |
protected void runTeardown() {
Assert.assertTrue("HTTP connection is not allowed", messagedAccessDenied);
} | CWE-862 | 8 |
public ConstraintValidatorContext getContext() {
return context;
} | CWE-74 | 1 |
public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) {
//便于Wappalyzer读取
response.addHeader("X-ZrLog", BlogBuildInfoUtil.getVersion());
boolean isPluginPath = false;
for (String path : pluginHandlerPaths) {
if (ta... | CWE-863 | 11 |
protected DocumentReference resolveTemplate(String template)
{
if (StringUtils.isNotBlank(template)) {
DocumentReference templateReference = this.currentmixedReferenceResolver.resolve(template);
// Make sure the current user have access to the template document before copying it... | CWE-862 | 8 |
public void translate(ServerEntityRotationPacket packet, GeyserSession session) {
Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId());
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
entity = session.getPlayerEntity();
}
... | CWE-287 | 4 |
public void translate(ServerDisconnectPacket packet, GeyserSession session) {
session.disconnect(MessageTranslator.convertMessage(packet.getReason(), session.getLocale()));
} | CWE-287 | 4 |
public void translate(ServerUpdateScorePacket packet, GeyserSession session) {
WorldCache worldCache = session.getWorldCache();
Scoreboard scoreboard = worldCache.getScoreboard();
int pps = worldCache.increaseAndGetScoreboardPacketsPerSecond();
Objective objective = scoreboard.getOb... | CWE-287 | 4 |
public void translate(ServerPingPacket packet, GeyserSession session) {
session.sendDownstreamPacket(new ClientPongPacket(packet.getId()));
} | CWE-287 | 4 |
public void existingDocumentNonTerminalFromUIDeprecatedIgnoringPage() 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 testContainsNameAndValue() {
final HttpHeadersBase headers = newHttp2Headers();
assertThat(headers.contains("name1", "value2")).isTrue();
assertThat(headers.contains("name1", "Value2")).isFalse();
assertThat(headers.contains("name2", "value3")).isTrue();
assertTha... | CWE-74 | 1 |
public void existingDocumentFromUITemplateProviderExistingButNoneSelected() throws Exception
{
// current document = xwiki:Main.WebHome
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome");
XWikiDocument document = mock(XWikiDocument.clas... | CWE-862 | 8 |
public void newDocumentFromURL() throws Exception
{
// new document = xwiki:X.Y
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("X"), "Y");
XWikiDocument document = mock(XWikiDocument.class);
when(document.getDocumentReference()).thenReturn(docu... | CWE-862 | 8 |
public void annotatedSubClassExample() throws Exception {
assertThat(ConstraintViolations.format(validator.validate(new AnnotatedSubclassExample())))
.containsExactlyInAnyOrder(
FAILED_RESULT,
FAILED_RESULT+"subclass"
);
assertThat(Test... | CWE-74 | 1 |
final void setObject(CharSequence name, Iterable<?> 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: val... | CWE-74 | 1 |
public String findFilter( String url_suffix )
{
if( url_suffix == null )
{
throw new IllegalArgumentException( "The url_suffix must not be null." );
}
CaptureType type = em.find( CaptureType.class, url_suffix );
if( type != null )
{
... | CWE-754 | 31 |
public void translate(ServerEntityEffectPacket packet, GeyserSession session) {
Entity entity;
if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) {
entity = session.getPlayerEntity();
session.getEffectCache().setEffect(packet.getEffect(), packet.getAmplifier... | CWE-287 | 4 |
public void translate(ServerBossBarPacket packet, GeyserSession session) {
BossBar bossBar = session.getEntityCache().getBossBar(packet.getUuid());
switch (packet.getAction()) {
case ADD:
long entityId = session.getEntityCache().getNextEntityId().incrementAndGet();
... | CWE-287 | 4 |
void setup()
{
this.saveAction = new SaveAction();
context = oldcore.getXWikiContext();
xWiki = mock(XWiki.class);
context.setWiki(this.xWiki);
mockRequest = mock(XWikiRequest.class);
context.setRequest(mockRequest);
mockResponse = mock(XWikiResponse.c... | CWE-862 | 8 |
private void processExtras(Bundle extras) {
final String downloadUuid = extras.getString(ConversationsActivity.EXTRA_DOWNLOAD_UUID);
final String text = extras.getString(Intent.EXTRA_TEXT);
final String nick = extras.getString(ConversationsActivity.EXTRA_NICK);
final boolean asQuote ... | CWE-200 | 10 |
public void subValidateFail(ViolationCollector col) {
col.addViolation(FAILED+"subclass");
} | CWE-74 | 1 |
public void addViolation(String propertyName, Integer index, String message) {
violationOccurred = true;
String messageTemplate = escapeEl(message);
context.buildConstraintViolationWithTemplate(messageTemplate)
.addPropertyNode(propertyName)
.addBeanNode().inI... | CWE-74 | 1 |
public void translate(ServerStatisticsPacket packet, GeyserSession session) {
session.updateStatistics(packet.getStatistics());
if (session.isWaitingForStatistics()) {
session.setWaitingForStatistics(false);
StatisticsUtils.buildAndSendStatisticsMenu(session);
}
... | CWE-287 | 4 |
default Optional<Integer> findInt(CharSequence name) {
return get(name, Integer.class);
} | CWE-400 | 2 |
public void existingDocumentFromUINoName() throws Exception
{
// current document = xwiki:Main.WebHome
DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome");
XWikiDocument document = mock(XWikiDocument.class);
when(document.getDocu... | CWE-862 | 8 |
public Element handle(Element request, Map<String, Object> context) throws ServiceException {
ZimbraSoapContext zsc = getZimbraSoapContext(context);
Account account = getRequestedAccount(getZimbraSoapContext(context));
if (!canAccessAccount(zsc, account))
throw ServiceException.... | CWE-862 | 8 |
public void testUpdateUser() throws Exception {
Set<JpaRole> authorities = new HashSet<JpaRole>();
authorities.add(new JpaRole("ROLE_ASTRO_101_SPRING_2011_STUDENT", org1));
JpaUser user = new JpaUser("user1", "pass1", org1, provider.getName(), true, authorities);
provider.addUser(user);
User loa... | CWE-327 | 3 |
public String compact() {
return id.replaceAll("/", "-").replaceAll("\\\\", "-");
} | CWE-74 | 1 |
public void translate(ServerSpawnLivingEntityPacket packet, GeyserSession session) {
Vector3f position = Vector3f.from(packet.getX(), packet.getY(), packet.getZ());
Vector3f motion = Vector3f.from(packet.getMotionX(), packet.getMotionY(), packet.getMotionZ());
Vector3f rotation = Vector3f.fr... | CWE-287 | 4 |
public synchronized MultiMap headers() {
if (headers == null) {
headers = new CaseInsensitiveHeaders();
}
return headers;
} | CWE-20 | 0 |
public static <T> T withPassword(AuthenticationRequestType type, Properties info,
PasswordAction<char @Nullable [], T> action) throws PSQLException, IOException {
char[] password = null;
String authPluginClassName = PGProperty.AUTHENTICATION_PLUGIN_CLASS_NAME.get(info);
if (authPluginClassName == ... | CWE-665 | 32 |
public void submoduleAdd(String repoUrl, String submoduleNameToPutInGitSubmodules, String folder) {
String[] addSubmoduleWithSameNameArgs = new String[]{"submodule", "add", repoUrl, folder};
String[] changeSubmoduleNameInGitModules = new String[]{"config", "--file", ".gitmodules", "--rename-section"... | CWE-77 | 14 |
public Argument<Session> argumentType() {
return Argument.of(Session.class);
} | CWE-400 | 2 |
private Job startCreateJob(EntityReference entityReference, EditForm editForm) throws XWikiException
{
if (StringUtils.isBlank(editForm.getTemplate())) {
// No template specified, nothing more to do.
return null;
}
// If a template is set in the request, then thi... | CWE-862 | 8 |
public void setShouldOverWritePreviousValue() {
final HttpHeadersBase headers = newEmptyHeaders();
headers.set("name", "value1");
headers.set("name", "value2");
assertThat(headers.size()).isEqualTo(1);
assertThat(headers.getAll("name").size()).isEqualTo(1);
assertThat... | CWE-74 | 1 |
public int checkSessionsValidity() {
int expired = 0;
acquireExclusiveLock();
try {
final long now = System.currentTimeMillis();
Entry<String, OHttpSession> s;
for (Iterator<Map.Entry<String, OHttpSession>> it = sessions.entrySet().iterator(); it.hasNext();) {
... | CWE-200 | 10 |
public void translate(ServerUpdateTimePacket packet, GeyserSession session) {
// Bedrock sends a GameRulesChangedPacket if there is no daylight cycle
// Java just sends a negative long if there is no daylight cycle
long time = packet.getTime();
// https://minecraft.gamepedia.com/Day... | CWE-287 | 4 |
public void translate(ServerWindowPropertyPacket packet, GeyserSession session) {
Inventory inventory = InventoryUtils.getInventory(session, packet.getWindowId());
if (inventory == null)
return;
InventoryTranslator translator = session.getInventoryTranslator();
if (trans... | CWE-287 | 4 |
protected DataSource createDataSource(Map<String, ?> params, SQLDialect dialect)
throws IOException {
String jndiName = (String) JNDI_REFNAME.lookUp(params);
if (jndiName == null) throw new IOException("Missing " + JNDI_REFNAME.description);
Context ctx = null;
DataSourc... | CWE-20 | 0 |
public void iteratorShouldReturnAllNameValuePairs() {
final HttpHeadersBase headers1 = newEmptyHeaders();
headers1.add("name1", "value1", "value2");
headers1.add("name2", "value3");
headers1.add("name3", "value4", "value5", "value6");
headers1.add("name1", "value7", "value8")... | CWE-74 | 1 |
protected BigInteger chooseRandomPrime(int bitlength, BigInteger e, BigInteger sqrdBound)
{
int iterations = getNumberOfIterations(bitlength, param.getCertainty());
for (int i = 0; i != 5 * bitlength; i++)
{
BigInteger p = new BigInteger(bitlength, 1, param.getRandom());
... | CWE-327 | 3 |
public void setAllShouldOverwriteSomeAndLeaveOthersUntouched() {
final HttpHeadersBase h1 = newEmptyHeaders();
h1.add("name1", "value1");
h1.add("name2", "value2");
h1.add("name2", "value3");
h1.add("name3", "value4");
final HttpHeadersBase h2 = newEmptyHeaders();
... | CWE-74 | 1 |
private DocumentReferenceResolver<String> getCurrentMixedDocumentReferenceResolver()
{
return Utils.getComponent(DocumentReferenceResolver.TYPE_STRING, CURRENT_MIXED_RESOLVER_HINT);
} | CWE-862 | 8 |
public void translate(ServerMultiBlockChangePacket packet, GeyserSession session) {
for (BlockChangeRecord record : packet.getRecords()) {
ChunkUtils.updateBlock(session, record.getBlock(), record.getPosition());
}
} | CWE-287 | 4 |
public String createSession(final String iDatabaseName, final String iUserName, final String iUserPassword) {
acquireExclusiveLock();
try {
final String id = "OS" + System.currentTimeMillis() + random.nextLong();
sessions.put(id, new OHttpSession(id, iDatabaseName, iUserName, iUserPasswor... | CWE-200 | 10 |
public static void endRequest() {
final List<RequestScopedItem> result = CACHE.get();
CACHE.remove();
if (result != null) {
for (final RequestScopedItem item : result) {
item.invalidate();
}
}
} | CWE-362 | 18 |
protected void showCreateContactDialog(final String prefilledJid, final Invite invite) {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
Fragment prev = getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_DIALOG);
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(nul... | CWE-200 | 10 |
Randoms() {
random = new Random();
Date date = new Date();
random.setSeed(date.getTime());
} | CWE-327 | 3 |
public void translate(ServerVehicleMovePacket packet, GeyserSession session) {
Entity entity = session.getRidingVehicleEntity();
if (entity == null) return;
entity.moveAbsolute(session, Vector3f.from(packet.getX(), packet.getY(), packet.getZ()), packet.getYaw(), packet.getPitch(), false, tr... | CWE-287 | 4 |
public void testComputeLength() {
byte[] aad = new byte[]{0, 1, 2, 3}; // 32 bits
byte[] expectedBitLength = new byte[]{0, 0, 0, 0, 0, 0, 0, 32};
assertTrue(Arrays.equals(expectedBitLength, AAD.computeLength(aad)));
} | CWE-345 | 22 |
public void failingExample() throws Exception {
assertThat(ConstraintViolations.format(validator.validate(new FailingExample())))
.containsExactlyInAnyOrder(FAILED_RESULT);
assertThat(TestLoggerFactory.getAllLoggingEvents())
.isEmpty();
} | CWE-74 | 1 |
public void testSetOrdersPseudoHeadersCorrectly() {
final HttpHeadersBase headers = newHttp2Headers();
final HttpHeadersBase other = newEmptyHeaders();
other.add("name2", "value2");
other.add("name3", "value3");
other.add("name4", "value4");
other.authority("foo");
... | CWE-74 | 1 |
public void setHeadersShouldClearAndOverwrite() {
final HttpHeadersBase headers1 = newEmptyHeaders();
headers1.add("name", "value");
final HttpHeadersBase headers2 = newEmptyHeaders();
headers2.add("name", "newvalue");
headers2.add("name1", "value1");
headers1.set(h... | CWE-74 | 1 |
public void add(File fileToAdd) {
String[] args = new String[]{"add", fileToAdd.getName()};
CommandLine gitAdd = gitWd().withArgs(args);
runOrBomb(gitAdd);
} | CWE-77 | 14 |
public void addUser(JpaUser user) throws UnauthorizedException {
if (!UserDirectoryUtils.isCurrentUserAuthorizedHandleRoles(securityService, user.getRoles()))
throw new UnauthorizedException("The user is not allowed to set the admin role on other users");
// Create a JPA user with an encoded password.
... | CWE-327 | 3 |
public SecureIntrospector(String[] badClasses, String[] badPackages, Logger log)
{
super(badClasses, badPackages, log);
this.secureClassMethods.add("getname");
this.secureClassMethods.add("getName");
this.secureClassMethods.add("getsimpleName");
this.secureClassMethods.a... | CWE-668 | 7 |
protected void afterFeaturesReceived() throws SecurityRequiredException, NotConnectedException {
StartTls startTlsFeature = getFeature(StartTls.ELEMENT, StartTls.NAMESPACE);
if (startTlsFeature != null) {
if (startTlsFeature.required() && config.getSecurityMode() == SecurityMode.disabled... | CWE-362 | 18 |
public int clone(ConsoleOutputStreamConsumer outputStreamConsumer, UrlArgument repositoryUrl) {
CommandLine hg = createCommandLine("hg").withArgs("clone").withArg("-b").withArg(branch).withArg(repositoryUrl)
.withArg(workingDir.getAbsolutePath()).withNonArgSecrets(secrets).withEncoding("utf-... | CWE-77 | 14 |
public void handle(HttpServletRequest request, 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();
D... | CWE-200 | 10 |
public void translate(ServerUpdateViewPositionPacket packet, GeyserSession session) {
if (!session.isSpawned() && session.getLastChunkPosition() == null) {
ChunkUtils.updateChunkPosition(session, Vector3i.from(packet.getChunkX() << 4, 64, packet.getChunkZ() << 4));
}
} | CWE-287 | 4 |
public String invokeServletAndReturnAsString(String url)
{
return this.xwiki.invokeServletAndReturnAsString(url, getXWikiContext());
} | CWE-862 | 8 |
public void checkAccess(Thread t) {
if (RobocodeProperties.isSecurityOff()) {
return;
}
Thread c = Thread.currentThread();
if (isSafeThread(c)) {
return;
}
super.checkAccess(t);
// Threads belonging to other thread groups is not allowed to access threads belonging to other thread groups
// Bug... | CWE-862 | 8 |
public void translate(EmotePacket packet, GeyserSession session) {
if (session.getConnector().getConfig().getEmoteOffhandWorkaround() != EmoteOffhandWorkaroundOption.DISABLED) {
// Activate the workaround - we should trigger the offhand now
ClientPlayerActionPacket swapHandsPacket = ... | CWE-287 | 4 |
public void validateConcreteScmMaterial(ValidationContext validationContext) {
if (getView() == null || getView().trim().isEmpty()) {
errors.add(VIEW, "P4 view cannot be empty.");
}
if (StringUtils.isBlank(getServerAndPort())) {
errors.add(SERVER_AND_PORT, "P4 port ca... | CWE-77 | 14 |
public void switchToConversationAndQuote(Conversation conversation, String text) {
switchToConversation(conversation, text, true, null, false);
} | CWE-200 | 10 |
public boolean matches(ConditionContext context) {
BeanContext beanContext = context.getBeanContext();
if (beanContext instanceof ApplicationContext) {
List<String> paths = ((ApplicationContext) beanContext)
.getEnvironment()
.getProperty(FileWatch... | CWE-400 | 2 |
private String doResolveSqlDriverNameFromJar(File driverFile) {
JarFile jarFile = null;
try {
jarFile = new JarFile(driverFile);
} catch (IOException e) {
log.error("resolve driver class name error", e);
throw DomainErrors.DRIVER_CLASS_NAME_OBTAIN_ERROR.ex... | CWE-20 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.