Language: Java
Label: safe
CWE: CWE-502 \u2014 Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.

Code:
	public boolean tryIserting(World world, EntityPlayer entityplayer) {
		if(entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == LogisticsPipes.UpgradeItem.itemID && LogisticsPipes.UpgradeItem.getUpgradeForItem(entityplayer.getCurrentEquippedItem(), null).isAllowed(pipe)) {
			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;
	}