code
stringlengths 14
2.05k
| label
int64 0
1
| programming_language
stringclasses 7
values | cwe_id
stringlengths 6
14
| cwe_name
stringlengths 5
98
⌀ | description
stringlengths 36
379
⌀ | url
stringlengths 36
48
⌀ | label_name
stringclasses 2
values |
---|---|---|---|---|---|---|---|
public static Map processResponse(Response samlResponse, String target)
throws SAMLException {
List assertions = null;
SAMLServiceManager.SOAPEntry partnerdest = null;
Subject assertionSubject = null;
if (samlResponse.isSigned()) {
// verify the signature
boolean isSignedandValid = verifySignature(samlResponse);
if (!isSignedandValid) {
throw new SAMLException(bundle.getString("invalidResponse"));
}
}
// check Assertion and get back a Map of relevant data including,
// Subject, SOAPEntry for the partner and the List of Assertions.
Map ssMap = verifyAssertionAndGetSSMap(samlResponse);
if (debug.messageEnabled()) {
debug.message("processResponse: ssMap = " + ssMap);
}
if (ssMap == null) {
throw new SAMLException(bundle.getString("invalidAssertion"));
}
assertionSubject = (com.sun.identity.saml.assertion.Subject)
ssMap.get(SAMLConstants.SUBJECT);
if (assertionSubject == null) {
throw new SAMLException(bundle.getString("nullSubject"));
}
partnerdest = (SAMLServiceManager.SOAPEntry)ssMap
.get(SAMLConstants.SOURCE_SITE_SOAP_ENTRY);
if (partnerdest == null) {
throw new SAMLException(bundle.getString("failedAccountMapping"));
}
assertions = (List)ssMap.get(SAMLConstants.POST_ASSERTION);
Map sessMap = null;
try {
sessMap = getAttributeMap(partnerdest, assertions,
assertionSubject, target);
} catch (Exception se) {
debug.error("SAMLUtils.processResponse :" , se);
throw new SAMLException(
bundle.getString("failProcessResponse"));
}
return sessMap;
} | 0 | Java | CWE-287 | Improper Authentication | When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. | https://cwe.mitre.org/data/definitions/287.html | vulnerable |
public void shutdown() {
if (connection != null) {
try {
connection.close();
} catch (SQLException e) {
logger.warn("Non-Managed connection could not be closed. Whoops!", e);
}
}
} | 0 | Java | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
private static String getDatabaseUrl(DatabaseConfiguration dbConfig) {
int port = dbConfig.getDatabasePort();
return "jdbc:" + dbConfig.getDatabaseType().toLowerCase() + "://" + dbConfig.getDatabaseHost()
+ ((port == 0) ? "" : (":" + port)) + "/" + dbConfig.getDatabaseName();
} | 0 | Java | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
public Connection getConnection(DatabaseConfiguration databaseConfiguration, boolean forceNewConnection)
throws DatabaseServiceException {
try {
// logger.info("connection::{}, forceNewConnection: {}", connection, forceNewConnection);
if (connection != null && !forceNewConnection) {
// logger.debug("connection closed::{}", connection.isClosed());
if (!connection.isClosed()) {
if (logger.isDebugEnabled()) {
logger.debug("Returning existing connection::{}", connection);
}
return connection;
}
}
Class.forName(type.getClassPath());
DriverManager.setLoginTimeout(10);
String dbURL = getDatabaseUrl(databaseConfiguration);
connection = DriverManager.getConnection(dbURL, databaseConfiguration.getDatabaseUser(),
databaseConfiguration.getDatabasePassword());
if (logger.isDebugEnabled()) {
logger.debug("*** Acquired New connection for ::{} **** ", dbURL);
}
return connection;
} catch (ClassNotFoundException e) {
logger.error("Jdbc Driver not found", e);
throw new DatabaseServiceException(e.getMessage());
} catch (SQLException e) {
logger.error("SQLException::Couldn't get a Connection!", e);
throw new DatabaseServiceException(true, e.getSQLState(), e.getErrorCode(), e.getMessage());
}
} | 0 | Java | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
public Connection getConnection(DatabaseConfiguration databaseConfiguration, boolean forceNewConnection)
throws DatabaseServiceException {
try {
if (connection != null && !forceNewConnection) {
// logger.info("connection closed::{}", connection.isClosed());
if (!connection.isClosed()) {
if (logger.isDebugEnabled()) {
logger.debug("Returning existing connection::{}", connection);
}
return connection;
}
}
String dbURL = getDatabaseUrl(databaseConfiguration);
Class.forName(type.getClassPath());
// logger.info("*** type.getClassPath() ::{}, {}**** ", type.getClassPath());
DriverManager.setLoginTimeout(10);
connection = DriverManager.getConnection(dbURL, databaseConfiguration.getDatabaseUser(),
databaseConfiguration.getDatabasePassword());
if (logger.isDebugEnabled()) {
logger.debug("*** Acquired New connection for ::{} **** ", dbURL);
}
return connection;
} catch (ClassNotFoundException e) {
logger.error("Jdbc Driver not found", e);
throw new DatabaseServiceException(e.getMessage());
} catch (SQLException e) {
logger.error("SQLException::Couldn't get a Connection!", e);
throw new DatabaseServiceException(true, e.getSQLState(), e.getErrorCode(), e.getMessage());
}
} | 0 | Java | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
private String getDatabaseUrl(DatabaseConfiguration dbConfig) {
int port = dbConfig.getDatabasePort();
return "jdbc:" + dbConfig.getDatabaseType() + "://" + dbConfig.getDatabaseHost()
+ ((port == 0) ? "" : (":" + port)) + "/" + dbConfig.getDatabaseName() + "?useSSL=" + dbConfig.isUseSSL();
} | 0 | Java | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
private static String getDatabaseUrl(DatabaseConfiguration dbConfig) {
int port = dbConfig.getDatabasePort();
return "jdbc:" + dbConfig.getDatabaseType().toLowerCase() + "://" + dbConfig.getDatabaseHost()
+ ((port == 0) ? "" : (":" + port)) + "/" + dbConfig.getDatabaseName();
} | 0 | Java | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
public Connection getConnection(DatabaseConfiguration databaseConfiguration, boolean forceNewConnection)
throws DatabaseServiceException {
try {
// logger.info("connection::{}, forceNewConnection: {}", connection, forceNewConnection);
if (connection != null && !forceNewConnection) {
// logger.info("connection closed::{}", connection.isClosed());
if (!connection.isClosed()) {
if (logger.isDebugEnabled()) {
logger.debug("Returning existing connection::{}", connection);
}
return connection;
}
}
Class.forName(type.getClassPath());
DriverManager.setLoginTimeout(10);
String dbURL = getDatabaseUrl(databaseConfiguration);
connection = DriverManager.getConnection(dbURL, databaseConfiguration.getDatabaseUser(),
databaseConfiguration.getDatabasePassword());
logger.debug("*** Acquired New connection for ::{} **** ", dbURL);
return connection;
} catch (ClassNotFoundException e) {
logger.error("Jdbc Driver not found", e);
throw new DatabaseServiceException(e.getMessage());
} catch (SQLException e) {
logger.error("SQLException::Couldn't get a Connection!", e);
throw new DatabaseServiceException(true, e.getSQLState(), e.getErrorCode(), e.getMessage());
}
} | 0 | Java | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
public static String getDatabaseUrl(DatabaseConfiguration dbConfig) {
return "jdbc:" + dbConfig.getDatabaseType().toLowerCase() + ":" + dbConfig.getDatabaseName();
} | 0 | Java | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
protected AbstractRequestContextBuilder(boolean server, RpcRequest rpcReq, URI uri) {
this.server = server;
req = null;
this.rpcReq = requireNonNull(rpcReq, "rpcReq");
method = HttpMethod.POST;
requireNonNull(uri, "uri");
authority = firstNonNull(uri.getRawAuthority(), FALLBACK_AUTHORITY);
sessionProtocol = getSessionProtocol(uri);
if (server) {
reqTarget = DefaultRequestTarget.createWithoutValidation(
RequestTargetForm.ORIGIN, null, null,
uri.getRawPath(), uri.getRawQuery(), null);
} else {
reqTarget = DefaultRequestTarget.createWithoutValidation(
RequestTargetForm.ORIGIN, null, null,
uri.getRawPath(), uri.getRawQuery(), uri.getRawFragment());
}
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
static RequestTarget forServer(String reqTarget) {
requireNonNull(reqTarget, "reqTarget");
return DefaultRequestTarget.forServer(reqTarget, Flags.allowDoubleDotsInQueryString());
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
private static RequestTarget slowAbsoluteFormForClient(String reqTarget, int authorityPos) {
// Extract scheme and authority while looking for path.
final URI schemeAndAuthority;
final String scheme = reqTarget.substring(0, authorityPos - 3);
final int nextPos = findNextComponent(reqTarget, authorityPos);
final String authority;
if (nextPos < 0) {
// Found no other components after authority
authority = reqTarget.substring(authorityPos);
} else {
// Path, query or fragment exists.
authority = reqTarget.substring(authorityPos, nextPos);
}
// Reject a URI with an empty authority.
if (authority.isEmpty()) {
return null;
}
// Normalize scheme and authority.
schemeAndAuthority = normalizeSchemeAndAuthority(scheme, authority);
if (schemeAndAuthority == null) {
// Invalid scheme or authority.
return null;
}
if (nextPos < 0) {
return new DefaultRequestTarget(RequestTargetForm.ABSOLUTE,
schemeAndAuthority.getScheme(),
schemeAndAuthority.getRawAuthority(),
"/",
null,
null);
}
return slowForClient(reqTarget, schemeAndAuthority, nextPos);
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
public RequestTarget withPath(String path) {
if (this.path == path) {
return this;
}
return new DefaultRequestTarget(form, scheme, authority, path, query, fragment);
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
public static RequestTarget forServer(String reqTarget, boolean allowDoubleDotsInQueryString) {
final RequestTarget cached = RequestTargetCache.getForServer(reqTarget);
if (cached != null) {
return cached;
}
return slowForServer(reqTarget, allowDoubleDotsInQueryString);
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
private static RequestTarget slowForServer(String reqTarget, boolean allowDoubleDotsInQueryString) {
final Bytes path;
final Bytes query;
// Split by the first '?'.
final int queryPos = reqTarget.indexOf('?');
if (queryPos >= 0) {
if ((path = decodePercentsAndEncodeToUtf8(
reqTarget, 0, queryPos,
ComponentType.SERVER_PATH, null)) == null) {
return null;
}
if ((query = decodePercentsAndEncodeToUtf8(
reqTarget, queryPos + 1, reqTarget.length(),
ComponentType.QUERY, EMPTY_BYTES)) == null) {
return null;
}
} else {
if ((path = decodePercentsAndEncodeToUtf8(
reqTarget, 0, reqTarget.length(),
ComponentType.SERVER_PATH, null)) == null) {
return null;
}
query = null;
}
// Reject a relative path and accept an asterisk (e.g. OPTIONS * HTTP/1.1).
if (isRelativePath(path)) {
if (query == null && path.length == 1 && path.data[0] == '*') {
return INSTANCE_ASTERISK;
} else {
// Do not accept a relative path.
return null;
}
}
// Reject the prohibited patterns.
if (pathContainsDoubleDots(path)) {
return null;
}
if (!allowDoubleDotsInQueryString && queryContainsDoubleDots(query)) {
return null;
}
return new DefaultRequestTarget(RequestTargetForm.ORIGIN,
null,
null,
encodePathToPercents(path),
encodeQueryToPercents(query),
null);
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
public static RequestTarget createWithoutValidation(
RequestTargetForm form, @Nullable String scheme, @Nullable String authority,
String path, @Nullable String query, @Nullable String fragment) {
return new DefaultRequestTarget(form, scheme, authority, path, query, fragment);
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
private DefaultRequestTarget(RequestTargetForm form, @Nullable String scheme, @Nullable String authority,
String path, @Nullable String query, @Nullable String fragment) {
assert (scheme != null && authority != null) ||
(scheme == null && authority == null) : "scheme: " + scheme + ", authority: " + authority;
this.form = form;
this.scheme = scheme;
this.authority = authority;
this.path = path;
this.query = query;
this.fragment = fragment;
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
private static RequestTarget forServer(String rawPath, boolean allowDoubleDotsInQueryString) {
final RequestTarget res = DefaultRequestTarget.forServer(rawPath, allowDoubleDotsInQueryString);
if (res != null) {
logger.info("forServer({}) => path: {}, query: {}", rawPath, res.path(), res.query());
} else {
logger.info("forServer({}) => null", rawPath);
}
return res;
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
void shouldNormalizeSemicolon(Mode mode) {
assertAccepted(parse(mode, "/;?a=b;c=d"), "/;", "a=b;c=d");
// '%3B' in a query string should never be decoded into ';'.
assertAccepted(parse(mode, "/%3b?a=b%3Bc=d"), "/;", "a=b%3Bc=d");
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
void shouldHandleSquareBracketsInPath(Mode mode) {
assertAccepted(parse(mode, "/@/:[]!$&'()*+,;="), "/@/:%5B%5D!$&'()*+,;=");
assertAccepted(parse(mode, "/%40%2F%3A%5B%5D%21%24%26%27%28%29%2A%2B%2C%3B%3D%3F"),
"/@%2F:%5B%5D!$&'()*+,;=%3F");
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
void serverShouldHandleReservedCharacters() {
assertAccepted(forServer("/#/:@!$&'()*+,;=?a=/#/:[]@!$&'()*+,;="),
"/%23/:@!$&'()*+,;=",
"a=/%23/:[]@!$&'()*+,;=");
assertAccepted(forServer("/%23%2F%3A%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%3F" +
"?a=%23%2F%3A%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%3F"),
"/%23%2F:@!$&'()*+,;=%3F",
"a=%23%2F%3A%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%3F");
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
void shouldReserveQuestionMark() {
// '%3F' must not be decoded into '?'.
assertAccepted(forServer("/abc%3F.json?a=%3F"), "/abc%3F.json", "a=%3F");
assertAccepted(forClient("/abc%3F.json?a=%3F"), "/abc%3F.json", "a=%3F");
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
new TypeReference<Map<String, Object>>() {}; | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
private static void fillRequest(
ServiceRequestContext ctx, AggregatedHttpRequest aReq, Request jReq) {
DispatcherTypeUtil.setRequestType(jReq);
jReq.setAsyncSupported(true, null);
jReq.setSecure(ctx.sessionProtocol().isTls());
jReq.setMetaData(toRequestMetadata(ctx, aReq));
final HttpHeaders trailers = aReq.trailers();
if (!trailers.isEmpty()) {
final HttpField[] httpFields = trailers.stream()
.map(e -> new HttpField(e.getKey().toString(), e.getValue()))
.toArray(HttpField[]::new);
jReq.setTrailerHttpFields(HttpFields.from(httpFields));
}
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
private static MetaData.Request toRequestMetadata(ServiceRequestContext ctx, AggregatedHttpRequest aReq) {
// Construct the HttpURI
final StringBuilder uriBuf = new StringBuilder();
final RequestHeaders aHeaders = aReq.headers();
uriBuf.append(ctx.sessionProtocol().isTls() ? "https" : "http");
uriBuf.append("://");
uriBuf.append(aHeaders.authority());
uriBuf.append(aHeaders.path());
final HttpURI uri = HttpURI.build(HttpURI.build(uriBuf.toString()).path(ctx.mappedPath()))
.asImmutable();
final HttpField[] fields = aHeaders.stream().map(header -> {
final AsciiString k = header.getKey();
final String v = header.getValue();
if (k.charAt(0) != ':') {
return new HttpField(k.toString(), v);
}
if (HttpHeaderNames.AUTHORITY.equals(k) && !aHeaders.contains(HttpHeaderNames.HOST)) {
// Convert `:authority` to `host`.
return new HttpField(HttpHeaderNames.HOST.toString(), v);
}
return null;
}).filter(Objects::nonNull).toArray(HttpField[]::new);
final HttpFields jHeaders = HttpFields.from(fields);
return new MetaData.Request(aHeaders.method().name(), uri,
ctx.sessionProtocol().isMultiplex() ? HttpVersion.HTTP_2
: HttpVersion.HTTP_1_1,
jHeaders, aReq.content().length());
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
private static URI uri(HttpRequest req) {
final String scheme = req.scheme();
final String authority = req.authority();
// Server side Armeria HTTP request always has the scheme and authority.
assert scheme != null;
assert authority != null;
return URI.create(scheme + "://" + authority + req.path());
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
ArmeriaServerHttpRequest(ServiceRequestContext ctx,
HttpRequest req,
DataBufferFactoryWrapper<?> factoryWrapper) {
super(uri(req), null, springHeaders(req.headers()));
this.ctx = requireNonNull(ctx, "ctx");
this.req = req;
body = Flux.from(req).cast(HttpData.class).map(factoryWrapper::toDataBuffer)
// Guarantee that the context is accessible from a controller method
// when a user specify @RequestBody in order to convert a request body into an object.
.publishOn(Schedulers.fromExecutor(ctx.eventLoop()));
} | 0 | Java | NVD-CWE-noinfo | null | null | null | vulnerable |
public void initGui() {
super.initGui();
controlList.add(new SmallGuiButton(0, (width-xSize) / 2 + 164, (height - ySize) / 2 + 50, 10,10, ">"));
controlList.add(new SmallGuiButton(1, (width-xSize) / 2 + 129, (height - ySize) / 2 + 50, 10,10, "<"));
//controlList.add(new SmallGuiButton(2, (width-xSize) / 2 + 138, (height - ySize) / 2 + 75, 30,10, "Paint"));
controlList.add(new SmallGuiButton(3, (width-xSize) / 2 + 47, (height - ySize) / 2 + 50, 37,10, "Import"));
controlList.add(new SmallGuiButton(4, (width-xSize) / 2 + 15, (height - ySize) / 2 + 50, 28,10, "Open"));
for(int i = 0; i < 6; i++) {
controlList.add(buttonarray[i] = new SmallGuiButton(5 + i, (width-xSize) / 2 + 20 + 18 * i, (height - ySize) / 2 + 37, 10,10, ">"));
buttonarray[i].drawButton = false;
}
controlList.add(new SmallGuiButton(20, (width-xSize) / 2 + 164, (height - ySize) / 2 + 85, 10,10, ">"));
controlList.add(new SmallGuiButton(21, (width-xSize) / 2 + 129, (height - ySize) / 2 + 85, 10,10, "<"));
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
protected void actionPerformed(GuiButton guibutton) {
if(5 <= guibutton.id && guibutton.id < 11) {
_logic.handleStackMove(guibutton.id - 5);
}
switch(guibutton.id){
case 0:
_logic.setNextSatellite(_player);
return;
case 1:
_logic.setPrevSatellite(_player);
return;
case 2:
_logic.paintPathToSatellite();
return;
case 3:
_logic.importFromCraftingTable(_player);
return;
case 4:
_logic.openAttachedGui(_player);
return;
case 20:
_logic.priorityUp(_player);
return;
case 21:
_logic.priorityDown(_player);
return;
default:
super.actionPerformed(guibutton);
return;
}
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public GuiCraftingPipe(EntityPlayer player, IInventory dummyInventory, BaseLogicCrafting logic) {
super(null);
_player = player;
DummyContainer dummy = new DummyContainer(player.inventory, dummyInventory);
dummy.addNormalSlotsForPlayerInventory(18, 97);
//Input slots
for(int l = 0; l < 9; l++) {
dummy.addDummySlot(l, 18 + l * 18, 18);
}
//Output slot
dummy.addDummySlot(9, 90, 64);
this.inventorySlots = dummy;
_logic = logic;
xSize = 195;
ySize = 187;
buttonarray = new GuiButton[6];
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
int i = mc.renderEngine.getTexture("/logisticspipes/gui/crafting.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(i);
int j = guiLeft;
int k = guiTop;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
drawRect(400, 400, 0, 0, 0x404040);
for(int count=36; count<42;count++) {
Slot slot = inventorySlots.getSlot(count);
if(slot != null && slot.getStack() != null && slot.getStack().getMaxStackSize() < 2) {
drawRect(guiLeft + 18 + (18 * (count-36)), guiTop + 18, guiLeft + 18 + (18 * (count-36)) + 16, guiTop + 18 + 16, 0xFFFF0000);
buttonarray[count - 36].drawButton = true;
} else {
buttonarray[count - 36].drawButton = false;
}
}
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
fontRenderer.drawString("Inputs", 18, 7, 0x404040);
fontRenderer.drawString("Output", 48, 67, 0x404040);
fontRenderer.drawString("Inventory", 18, 86, 0x404040);
fontRenderer.drawString("Satellite", 132, 7, 0x404040);
if (_logic.satelliteId == 0){
fontRenderer.drawString("Off", 144, 52, 0x404040);
} else {
fontRenderer.drawString(""+_logic.satelliteId , 155 - fontRenderer.getStringWidth(""+_logic.satelliteId) , 52, 0x404040);
/*
if (_logic.isSatelliteConnected()){
MinecraftForgeClient.bindTexture(mod_LogisticsPipes.LOGISTICSPIPE_ROUTED_TEXTURE_FILE);
}else{
MinecraftForgeClient.bindTexture(mod_LogisticsPipes.LOGISTICSPIPE_NOTROUTED_TEXTURE_FILE);
}*/
//TODO /\ /\ ???
//GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
//drawRect(0,1000,0,10000, 0xFFFF0000);
//drawTexturedModalRect(155, 50, 10 * (xSize / 16) , 0, 10, 10);
//MinecraftForgeClient.unbindTexture();
}
fontRenderer.drawString("Priority:" , 132 , 75, 0x404040);
fontRenderer.drawString(""+_logic.priority , 152 - (fontRenderer.getStringWidth(""+_logic.priority) / 2) , 87, 0x404040);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void setNextSatellite(EntityPlayer player) {
if (MainProxy.isClient(player.worldObj)) {
final PacketCoordinates packet = new PacketCoordinates(NetworkConstants.CRAFTING_PIPE_NEXT_SATELLITE, xCoord, yCoord, zCoord);
MainProxy.sendPacketToServer(packet.getPacket());
} else {
satelliteId = getNextConnectSatelliteId(false);
final PacketPipeInteger packet = new PacketPipeInteger(NetworkConstants.CRAFTING_PIPE_SATELLITE_ID, xCoord, yCoord, zCoord, satelliteId);
MainProxy.sendPacketToPlayer(packet.getPacket(), (Player)player);
}
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
protected int getNextConnectSatelliteId(boolean prev) {
final List<ExitRoute> routes = getRoutedPipe().getRouter().getIRoutersByCost();
int closestIdFound = prev ? 0 : Integer.MAX_VALUE;
for (final BaseLogicSatellite satellite : BaseLogicSatellite.AllSatellites) {
CoreRoutedPipe satPipe = satellite.getRoutedPipe();
if(satPipe == null || satPipe.stillNeedReplace() || satPipe.getRouter() == null)
continue;
IRouter satRouter = satPipe.getRouter();
for (ExitRoute route:routes){
if (route.destination == satRouter) {
if (!prev && satellite.satelliteId > satelliteId && satellite.satelliteId < closestIdFound) {
closestIdFound = satellite.satelliteId;
} else if (prev && satellite.satelliteId < satelliteId && satellite.satelliteId > closestIdFound) {
closestIdFound = satellite.satelliteId;
}
}
}
}
if (closestIdFound == Integer.MAX_VALUE) {
return satelliteId;
}
return closestIdFound;
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void setPrevSatellite(EntityPlayer player) {
if (MainProxy.isClient(player.worldObj)) {
final PacketCoordinates packet = new PacketCoordinates(NetworkConstants.CRAFTING_PIPE_PREV_SATELLITE, xCoord, yCoord, zCoord);
MainProxy.sendPacketToServer(packet.getPacket());
} else {
satelliteId = getNextConnectSatelliteId(true);
final PacketPipeInteger packet = new PacketPipeInteger(NetworkConstants.CRAFTING_PIPE_SATELLITE_ID, xCoord, yCoord, zCoord, satelliteId);
MainProxy.sendPacketToPlayer(packet.getPacket(), (Player)player);
}
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void setSatelliteId(int satelliteId) {
this.satelliteId = satelliteId;
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public boolean isSatelliteConnected() {
final List<ExitRoute> routes = getRoutedPipe().getRouter().getIRoutersByCost();
for (final BaseLogicSatellite satellite : BaseLogicSatellite.AllSatellites) {
if (satellite.satelliteId == satelliteId) {
CoreRoutedPipe satPipe = satellite.getRoutedPipe();
if(satPipe == null || satPipe.stillNeedReplace() || satPipe.getRouter() == null)
continue;
IRouter satRouter = satPipe.getRouter();
for (ExitRoute route:routes) {
if (route.destination == satRouter) {
return true;
}
}
}
}
return false;
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public IRouter getSatelliteRouter() {
for (final BaseLogicSatellite satellite : BaseLogicSatellite.AllSatellites) {
if (satellite.satelliteId == satelliteId) {
CoreRoutedPipe satPipe = satellite.getRoutedPipe();
if(satPipe == null || satPipe.stillNeedReplace() || satPipe.getRouter() == null)
continue;
return satPipe.getRouter();
}
}
return null;
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void paintPathToSatellite() {
final IRouter satelliteRouter = getSatelliteRouter();
if (satelliteRouter == null) {
return;
}
getRoutedPipe().getRouter().displayRouteTo(satelliteRouter.getSimpleID());
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public Pair<Integer, Integer> getBestReply(LiquidStack stack, IRouter sourceRouter, List<Integer> jamList) {
for (ExitRoute candidateRouter : sourceRouter.getIRoutersByCost()){
if(!candidateRouter.containsFlag(PipeRoutingConnectionType.canRouteTo)) continue;
if(candidateRouter.destination.getSimpleID() == sourceRouter.getSimpleID()) continue;
if(jamList.contains(candidateRouter.destination.getSimpleID())) continue;
if (candidateRouter.destination.getPipe() == null || !candidateRouter.destination.getPipe().isEnabled()) continue;
CoreRoutedPipe pipe = candidateRouter.destination.getPipe();
if(!(pipe instanceof ILiquidSink)) continue;
int amount = ((ILiquidSink)pipe).sinkAmount(stack);
if(amount > 0) {
Pair<Integer, Integer> result = new Pair<Integer, Integer>(candidateRouter.destination.getSimpleID(), amount);
return result;
}
}
Pair<Integer, Integer> result = new Pair<Integer, Integer>(null, 0);
return result;
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
private static void onCraftingPipeSetSatellite(PacketPipeInteger packet) {
final TileGenericPipe pipe = getPipe(FMLClientHandler.instance().getClient().theWorld, packet.posX, packet.posY, packet.posZ);
if (pipe == null) {
return;
}
if (!(pipe.pipe.logic instanceof BaseLogicCrafting)) {
return;
}
((BaseLogicCrafting) pipe.pipe.logic).setSatelliteId(packet.integer);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public CraftingTemplate addCrafting() {
if (!isEnabled()){
return null;
}
BaseLogicCrafting craftingLogic = (BaseLogicCrafting) this.logic;
ItemStack stack = craftingLogic.getCraftedItem();
if ( stack == null) return null;
boolean hasSatellite = craftingLogic.isSatelliteConnected();
if(craftingLogic.satelliteId != 0 && !hasSatellite) return null;
CraftingTemplate template = new CraftingTemplate(ItemIdentifierStack.GetFromStack(stack), this, craftingLogic.priority);
//Check all materials
for (int i = 0; i < 9; i++){
ItemStack resourceStack = craftingLogic.getMaterials(i);
if (resourceStack == null || resourceStack.stackSize == 0) continue;
if (i < 6 || !hasSatellite) {
template.addRequirement(ItemIdentifierStack.GetFromStack(resourceStack), this);
} else {
template.addRequirement(ItemIdentifierStack.GetFromStack(resourceStack), (IRequestItems)craftingLogic.getSatelliteRouter().getPipe());
}
}
return template;
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public boolean tryIserting(World world, EntityPlayer entityplayer) {
if(entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == LogisticsPipes.UpgradeItem.itemID) {
if(MainProxy.isClient(world)) return true;
for(int i=0;i<inv.getSizeInventory() - 1;i++) {
ItemStack item = inv.getStackInSlot(i);
if(item == null) {
inv.setInventorySlotContents(i, entityplayer.getCurrentEquippedItem().splitStack(1));
InventoryChanged(inv);
return true;
} else if(item.getItemDamage() == entityplayer.getCurrentEquippedItem().getItemDamage()) {
if(item.stackSize < inv.getInventoryStackLimit()) {
item.stackSize++;
entityplayer.getCurrentEquippedItem().splitStack(1);
return true;
}
}
}
}
if(entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == LogisticsPipes.LogisticsItemCard.itemID && entityplayer.getCurrentEquippedItem().getItemDamage() == LogisticsItemCard.SEC_CARD) {
if(MainProxy.isClient(world)) return true;
if(inv.getStackInSlot(8) == null) {
inv.setInventorySlotContents(8, entityplayer.getCurrentEquippedItem().copy());
inv.getStackInSlot(8).stackSize = 1;
entityplayer.getCurrentEquippedItem().splitStack(1);
return true;
}
}
return false;
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public DummyContainer getDummyContainer(EntityPlayer player) {
DummyContainer dummy = new DummyContainer(player.inventory, inv);
dummy.addNormalSlotsForPlayerInventory(8, 60);
//Pipe slots
for(int pipeSlot = 0; pipeSlot < 8; pipeSlot++){
dummy.addRestrictedSlot(pipeSlot, inv, 8 + pipeSlot * 18, 18, LogisticsPipes.UpgradeItem.itemID);
}
dummy.addRestrictedSlot(8, inv, 8 + 8 * 18, 18, new ISlotCheck() {
@Override
public boolean isStackAllowed(ItemStack itemStack) {
if(itemStack == null) return false;
if(itemStack.itemID != LogisticsPipes.LogisticsItemCard.itemID) return false;
if(itemStack.getItemDamage() != LogisticsItemCard.SEC_CARD) return false;
return true;
}
});
return dummy;
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeToLPData(LPDataOutput output) throws IOException {
output.writeLongArray(amountRecorded);
output.writeInt(arrayPos);
output.writeItemIdentifier(item);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readFromLPData(LPDataInput input) throws IOException {
amountRecorded = input.readLongArray();
arrayPos = input.readInt();
item = input.readItemIdentifier();
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void setUseNewRenderer(boolean flag) {
useNewRenderer = flag;
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
useNewRenderer = input.readBoolean();
useFallbackRenderer = input.readBoolean();
renderPipeDistance = input.readInt();
renderPipeContentDistance = input.readInt();
isUninitialised = false;
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
output.writeBoolean(useNewRenderer);
output.writeBoolean(useFallbackRenderer);
output.writeInt(renderPipeDistance);
output.writeInt(renderPipeContentDistance);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
super.handlerAdded(ctx);
ctx.attr(PacketHandler.INBOUNDPACKETTRACKER).set(new ThreadLocal<>());
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
private static void onPacketData(ModernPacket packet, final EntityPlayer player) {
try {
packet.processPacket(player);
if (LPConstants.DEBUG) {
PacketHandler.debugMap.remove(packet.getDebugId());
}
} catch (DelayPacketException e) {
if (packet.retry() && MainProxy.isClient(player.getEntityWorld())) {
SimpleServiceLocator.clientBufferHandler.queueFailedPacket(packet, player);
} else if (LPConstants.DEBUG) {
LogisticsPipes.log.error(packet.getClass().getName());
LogisticsPipes.log.error(packet.toString());
e.printStackTrace();
}
} catch (Exception e) {
throw new RuntimeException(e);
}
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public static void onPacketData(final LPDataInput data, final EntityPlayer player) throws IOException {
if (player == null) {
return;
}
final int packetID = data.readShort();
final ModernPacket packet = PacketHandler.packetlist.get(packetID).template();
packet.setDebugId(data.readInt());
packet.readData(data);
PacketHandler.onPacketData(packet, player);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
InboundModernPacketWrapper(ModernPacket p, EntityPlayer e) {
packet = p;
player = e;
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeBoolean(flag);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
flag = input.readBoolean();
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public BooleanModuleCoordinatesGuiProvider(int id) {
super(id);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
output.writeInt(posX);
output.writeInt(posY);
output.writeInt(posZ);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
posX = input.readInt();
posY = input.readInt();
posZ = input.readInt();
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public CoordinatesGuiProvider(int id) {
super(id);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
posX = input.readInt();
posY = input.readInt();
posZ = input.readInt();
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
output.writeInt(posX);
output.writeInt(posY);
output.writeInt(posZ);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public CoordinatesPopupGuiProvider(int id) {
super(id);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
slot = input.readEnum(ModulePositionType.class);
positionInt = input.readInt();
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public ModuleCoordinatesGuiProvider(int id) {
super(id);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeEnum(slot);
output.writeInt(positionInt);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeInt(invSlot);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public ModuleInHandGuiProvider(int id) {
super(id);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
invSlot = input.readInt();
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
nbt = input.readNBTTagCompound();
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeNBTTagCompound(nbt);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public UpgradeCoordinatesGuiProvider(int id) {
super(id);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
positionInt = input.readInt();
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeInt(positionInt);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeBitSet(getFlags());
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
setFlags(input.readBitSet());
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeBoolean(flag);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
flag = input.readBoolean();
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
posX = input.readInt();
posY = input.readInt();
posZ = input.readInt();
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public CoordinatesPacket(int id) {
super(id);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
output.writeInt(posX);
output.writeInt(posY);
output.writeInt(posZ);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
direction = input.readForgeDirection();
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeForgeDirection(direction);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
setInteger2(input.readInt());
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeInt(getInteger2());
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeInt(getInteger2());
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
setInteger2(input.readInt());
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeInt(getInteger());
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
setInteger(input.readInt());
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
setInteger(input.readInt());
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeInt(getInteger());
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
setInteger(input.readInt());
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
output.writeInt(getInteger());
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
if (inventory != null) {
output.writeByte(STACK_MARKER);
output.writeInt(inventory.getSizeInventory());
for (int i = 0; i < inventory.getSizeInventory(); i++) {
output.writeItemStack(inventory.getStackInSlot(i));
}
} else if (stackList != null) {
output.writeByte(STACK_MARKER);
output.writeCollection(stackList, LPDataOutput::writeItemStack);
} else if (identList != null) {
output.writeByte(IDENT_MARKER);
output.writeCollection(identList, LPDataOutput::writeItemIdentifierStack);
} else if (identSet != null) {
output.writeByte(IDENT_MARKER);
output.writeCollection(identSet, LPDataOutput::writeItemIdentifierStack);
} else {
throw new IllegalStateException("Wont send packet without content");
}
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
byte marker = input.readByte();
if (marker == STACK_MARKER) {
stackList = input.readLinkedList(LPDataInput::readItemStack);
} else if (marker == IDENT_MARKER) {
identList = input.readLinkedList(LPDataInput::readItemIdentifierStack);
} else {
throw new UnsupportedOperationException("Unknown marker: " + marker);
}
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
final int itemID = input.readInt();
if (itemID != 0) {
int stackSize = input.readInt();
int damage = input.readInt();
setStack(new ItemStack(Item.getItemById(itemID), stackSize, damage));
getStack().setTagCompound(input.readNBTTagCompound());
} else {
setStack(null);
}
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
if (getStack() != null) {
output.writeInt(Item.getIdFromItem(getStack().getItem()));
output.writeInt(getStack().stackSize);
output.writeInt(getStack().getItemDamage());
output.writeNBTTagCompound(getStack().getTagCompound());
} else {
output.writeInt(0);
}
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void writeData(LPDataOutput output) throws IOException {
super.writeData(output);
output.writeCollection(list, this);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
public void readData(LPDataInput input) throws IOException {
super.readData(input);
list = input.readArrayList(this);
} | 0 | Java | CWE-502 | Deserialization of Untrusted Data | The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. | https://cwe.mitre.org/data/definitions/502.html | vulnerable |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.