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

Collection of small issues #93

Open
dedmen opened this issue Nov 23, 2018 · 5 comments
Open

Collection of small issues #93

dedmen opened this issue Nov 23, 2018 · 5 comments

Comments

@dedmen
Copy link
Contributor

dedmen commented Nov 23, 2018

I use this to document all the misc issues I find. That I don't know the appropriate answer to, to make a fix PR.

https://github.com/KoffeinFlummi/armake/blob/master/src/p3d.c#L1789
Makes no sense. num_lods is unsigned int, it can't be negative.

https://github.com/KoffeinFlummi/armake/blob/master/src/derapify.c#L572
target is never initialized. And only used for string comparison with buffer.

@dedmen
Copy link
Contributor Author

dedmen commented Dec 4, 2018

https://github.com/KoffeinFlummi/armake/blob/master/src/p3d.c#L1259 This is explosion shielding from v72
it actually belongs below invArmor and above special lods struct according to mikero

@dedmen
Copy link
Contributor Author

dedmen commented Dec 7, 2018

https://github.com/KoffeinFlummi/armake/blob/master/src/p3d.c#L842
Second tileU should be tileV

@dedmen
Copy link
Contributor Author

dedmen commented Dec 8, 2018

There is currently one level of "sectionsInherit"
https://github.com/KoffeinFlummi/armake/blob/master/src/model_config.c#L443
It should be recursive. If the inherited class has another sectionsInherit entry we need to follow that too.

@dedmen
Copy link
Contributor Author

dedmen commented Jan 2, 2019

Parser error
https://github.com/KoffeinFlummi/armake/blob/master/src/rapify.l#L117
This rejects the "unquoted string" case if there happens to be a number at the front.
x = 0.0447031 * safezoneW + safezoneX;
Oh look a number at the front! That means this can't possibly be a unquoted string!
Not sure what the workaround is.. Maybe make sure that there aren't any stray non-number characters left after the number that was detected?

Yep that worked for me

    auto res = std::from_chars(trimmedString.data(), trimmedString.data() + trimmedString.size(), val);
    if (res.ec != std::errc::invalid_argument) {//It's a number. They don't have to be quoted

        auto end = trimmedString.data() + trimmedString.size();

        //Basically only whitespace is allowed after that, if we have any stray characters, then this is not just a number but infact a unquoted string
        auto isEndClean = std::all_of(res.ptr, end, [](char x)
            {
                return x == '\n' || x == '\r' || x == ' ' || x == '\t';
            });
       
        if (isEndClean)//If end is not clean, this is not JUST a number.
            REJECT;
    }

@dedmen
Copy link
Contributor Author

dedmen commented Jan 31, 2019

https://github.com/KoffeinFlummi/armake/blob/master/src/keygen.c#L71
This can fail if the hex number would start with a 0. Like
0x08BF7BD...
The 0 at the start is ommited, meaning you end up with a string length that is not power of two.
len will be rounded down instead of up, resulting in 255 length when you expect 256, which will cut one whole byte off. Ending up with a 127 byte signature here: https://github.com/KoffeinFlummi/armake/blob/master/src/sign.c#L345

Here is a pbo where that happens with v2 signatures

core.zip

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

No branches or pull requests

1 participant