-
Notifications
You must be signed in to change notification settings - Fork 49
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
sslConfig_create didn't return a pointer #22
Comments
Hi @clearday4 Thank you for your finding ! You're right, the function should return sslConfig sslConfig_t *sslConfig_create(const char *clientCertFile, const char *clientKeyFile, const char *CACertFile, int insecureSkipTlsVerify) {
sslConfig_t *sslConfig = calloc(1, sizeof(sslConfig_t));
if ( clientCertFile ) {
sslConfig->clientCertFile = strdup(clientCertFile);
}
if ( clientKeyFile ) {
sslConfig->clientKeyFile = strdup(clientKeyFile);
}
if ( CACertFile ) {
sslConfig->CACertFile = strdup(CACertFile);
}
sslConfig->insecureSkipTlsVerify = insecureSkipTlsVerify;
<== Yes,sslConfig shoud be returned here. It's my fault.
} I have not found this issue before because the sslConfig is returned to caller actually. Maybe the compiler/gcc handles this defect and returns the sslConfig automatically. So this defect has no impact on gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04). But anyway, this defect should be fixed. I will handle it some times later. If anyone has interest, the fix should be done in the project OpenAPI-Generator/c Thank you. |
I suspect that this is because of x86 conventions and the pointer being stored in the same register as the expected return value: but we should definitely fix this. |
I filed: in the generator to fix this. |
The code generator patch is merged (though there are other issues that were detected) We should fix the other issues, and then regenerate. |
sslConfig_create() is not void function but not return a sslConfig pointer.
Need to add return sslConfig.
The text was updated successfully, but these errors were encountered: