push NULL on stack instead of 0; sizeof(NULL) > sizeof(0) in MinGW64,… #471
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… which results in an access violation when pulling.
When compiling asn1c with MinGW64 out of MSys64 the resulting asn1c.exe crashes with an access violation while parsing. The reason is the usage of va_arg libasn1compiler/asn1c_misc.c line 72. This pulls until a null value is read.
On different occations (int) 0 is being pushed on the stack instead of (intptr_t) NULL. Because sizeof(int) < sizeof(intptr_t) with this compiler too less data is pushed onto the stack, because what is being pushed is a char *, and sizeof(char *) == sizeof(intptr_t). Hence the access violation.
This patch fixes a possible problem on all platforms, and at least on MinGW64 a real problem.
The patch is relative to v0.9.28. It would be good to see a v0.9.29 coming with this, being compatible to v0.9.28 otherwise.