Bump INIClass line buffer to 256 bytes.#1047
Conversation
|
Although its not clear what Nod missions have this problem, a simply bump in this buffer shall not cause any undesired effects. Approved as trivial. |
No, this fix is not trivial. The extended MAX_LINE_LENGTH string will smash the stack and crash later in I believe the first mission with a long script string is SCB06EC. It seems, originally, the buffer reserved assumed to be 500 bytes long. Never that much in practice, yet hints are in the code. The regression commit was there: |
Sorry my initial issue report wasn't really good. The problem is that some TD missions have TeamTypes with a line length greater than 128, so your parser breaks those TeamTypes because it can't read them properly. The author of the refactor even run into the problem but draw the wrong conclusion, see comment in teamtype.cpp line 357. According to that comment it also affects GDI missions. Here are some Nod missions with TeamTypes that doesn't fit the read buffer: |
Fixes reported issues with later C&C missions.
|
Thanks for the detailed breakdown of the bug. The additional fixes should now solve the issues. Error is twofold, one the ini code made common with RA had a buffer that is too small for TD ini files and when an additional buffer was introduced to handle a switch to const char* parameters for Fill_In, I clearly missed a call site when I sized the buffer to just 128. |
|
@marodeur5 @SilverBird775 if either of you would like to confirm that the PR in its current state addresses all the issues you are aware of with the team parsing I'll go ahead and merge it. |
This PR clearly solves the most troublesome mission issues, SCB06EC playable again, no drawbacks noticed. |
Fixes reported issues with later C&C missions.
Fixes #1043