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

Ignore malformed orders instead of crashing. #15554

Merged
merged 1 commit into from Aug 25, 2018

Conversation

Projects
None yet
3 participants
@pchote
Member

pchote commented Aug 24, 2018

Implements a workaround for #15526 so that we can collect information that may eventually lead to a proper fix.

Testcase: Add the following to Order.Serialize to trigger a crash with the same stacktrace as #15526

diff --git a/OpenRA.Game/Network/Order.cs b/OpenRA.Game/Network/Order.cs
index 25b9aca186..70b4272c99 100644
--- a/OpenRA.Game/Network/Order.cs
+++ b/OpenRA.Game/Network/Order.cs
@@ -267,6 +267,13 @@ public byte[] Serialize()
                                w.Write((byte)0xFE);
                                w.Write(OrderString);
                                w.Write(TargetString);
+
+                               if (TargetString.StartsWith("map", StringComparison.Ordinal))
+                               {
+                                       var r = ret.ToArray();
+                                       return r.Take(r.Length - 3).ToArray();
+                               }
+
                                return ret.ToArray();
                        }

@pchote pchote added this to the Next release milestone Aug 24, 2018

@pchote pchote added the PR: Needs +2 label Aug 25, 2018

@reaperrr reaperrr merged commit 8475bd6 into OpenRA:bleed Aug 25, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment