Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Tank armor and invalid builds #1676

Closed
wants to merge 3 commits into from

Conversation

Scoppio
Copy link
Collaborator

@Scoppio Scoppio commented Jan 2, 2025

Implements test suite to validate all units in our current data folders.

Copy link

codecov bot commented Jan 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 2.14%. Comparing base (a2abcdd) to head (71248c5).
Report is 6 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##             master   #1676      +/-   ##
===========================================
- Coverage      2.14%   2.14%   -0.01%     
  Complexity      209     209              
===========================================
  Files           270     270              
  Lines         31247   31267      +20     
  Branches       5328    5329       +1     
===========================================
  Hits            670     670              
- Misses        30420   30440      +20     
  Partials        157     157              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

tmpFile = File.createTempFile("tmp_mekfiles/" + UUID.randomUUID() + "/" + file.getName(), ".blk");
}

if (UnitUtil.persistUnit(tmpFile, entity)) {

Check warning

Code scanning / CodeQL

Local information disclosure in a temporary directory Medium

Local information disclosure vulnerability due to use of file readable by other local users.

if (UnitUtil.persistUnit(tmpFile, entity)) {
Entity repersistedEntity = loadUnit(tmpFile);
var reValidation = UnitUtil.verify(repersistedEntity);

Check warning

Code scanning / CodeQL

Local information disclosure in a temporary directory Medium

Local information disclosure vulnerability due to use of file readable by other local users.
"The unit is invalid:\n\t" + entity.getDisplayName() + "\n" + validation.report());
File tmpFile;
if (entity instanceof Mek) {
tmpFile = File.createTempFile("tmp_mekfiles/" + UUID.randomUUID() + "/" + file.getName(), ".mtf");

Check warning

Code scanning / CodeQL

Local information disclosure in a temporary directory Medium

Local information disclosure vulnerability due to use of file readable by other local users.
if (entity instanceof Mek) {
tmpFile = File.createTempFile("tmp_mekfiles/" + UUID.randomUUID() + "/" + file.getName(), ".mtf");
} else {
tmpFile = File.createTempFile("tmp_mekfiles/" + UUID.randomUUID() + "/" + file.getName(), ".blk");

Check warning

Code scanning / CodeQL

Local information disclosure in a temporary directory Medium

Local information disclosure vulnerability due to use of file readable by other local users.
@HammerGS
Copy link
Member

HammerGS commented Jan 2, 2025

Given units are based in MegaMek for the builds etc, should these be a MegaMek Side fix?

@Scoppio Scoppio marked this pull request as ready for review January 2, 2025 21:09
@Scoppio
Copy link
Collaborator Author

Scoppio commented Jan 2, 2025

Agree

@Scoppio Scoppio closed this Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants