Skip to content

Bump INIClass line buffer to 256 bytes.#1047

Merged
OmniBlade merged 2 commits into
TheAssemblyArmada:vanillafrom
OmniBlade:fix/inibuff
Jul 16, 2026
Merged

Bump INIClass line buffer to 256 bytes.#1047
OmniBlade merged 2 commits into
TheAssemblyArmada:vanillafrom
OmniBlade:fix/inibuff

Conversation

@OmniBlade

Copy link
Copy Markdown
Contributor

Fixes reported issues with later C&C missions.

Fixes #1043

@giulianobelinassi

Copy link
Copy Markdown
Collaborator

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.

@SilverBird775

SilverBird775 commented Jul 10, 2026

Copy link
Copy Markdown

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
TeamTypeClass::Fill_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:
6d82561

@marodeur5

marodeur5 commented Jul 10, 2026

Copy link
Copy Markdown

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.

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:
scb03ea.ini - 159 chars
scb04ea.ini - 199 chars

@OmniBlade

Copy link
Copy Markdown
Contributor Author

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.

@OmniBlade

Copy link
Copy Markdown
Contributor Author

@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.

@SilverBird775

Copy link
Copy Markdown

@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.

@OmniBlade
OmniBlade merged commit ce83b59 into TheAssemblyArmada:vanilla Jul 16, 2026
36 checks passed
@OmniBlade
OmniBlade deleted the fix/inibuff branch July 16, 2026 13:57
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.

Ini parser breaks several Nod missions.

4 participants