Skip to content

Commit 1c9e903

Browse files
committed
Fix a possible bug that could allow an EDDN state with a systemAddress of zero (due to a shallow copy of the EDDN state rather than a deep copy).
1 parent 15c120d commit 1c9e903

2 files changed

Lines changed: 2 additions & 12 deletions

File tree

EDDNResponder/EDDNState.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ public EDDNState()
1515
Location = new LocationAugmenter();
1616
}
1717

18-
/// <summary>
19-
/// Copy constructor
20-
/// </summary>
21-
/// <param name="eddnState"></param>
22-
public EDDNState ( EDDNState eddnState )
23-
{
24-
GameVersion = eddnState.GameVersion;
25-
Location = eddnState.Location;
26-
}
27-
2818
public void GetStateInfo ( string edType, IDictionary<string, object> data )
2919
{
3020
// Attempt to obtain available game version data from the active event

EDDNResponder/Schemas/FSSSignalDiscoveredSchema.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public bool Handle(string edType, ref IDictionary<string, object> data, EDDNStat
3030
if ( eddnStates.All( s => s.Location?.systemAddress != eddnState.Location?.systemAddress ) &&
3131
eddnState.Location.StarSystemLocationIsSet() )
3232
{
33-
// Add a copy of the current EDDN state
34-
eddnStates.Add( new EDDNState( eddnState ) );
33+
// Add a deep copy of the current EDDN state
34+
eddnStates.Add( eddnState.Copy() );
3535
}
3636

3737
if ( !edTypes.Contains( edType ) )

0 commit comments

Comments
 (0)