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

Fix support for shading native libraries which was broken in b818852c… #8091

Merged
merged 1 commit into from
Jul 3, 2018

Conversation

normanmaurer
Copy link
Member

…db0ee56ce3cf939e2faa538d519baabd.

Motivation:

b818852 broke support for shading the native libraries in netty as it missed to respect the package prefix that is used when shading.

Modifications:

Correctly respect package prefix for constructor argument and include the used classname when logging that we could not find the constructor.

Result:

Be able to shade native libraries of netty again.

@normanmaurer
Copy link
Member Author

@cchantep please check as well ... thanks!

Motivation:

b818852 broke support for shading the native libraries in netty as it missed to respect the package prefix that is used when shading.

Modifications:

Correctly respect package prefix for constructor argument and include the used classname when logging that we could not find the constructor.

Result:

Be able to shade native libraries of netty again.
@normanmaurer
Copy link
Member Author

This fix was verified by @cchantep in #8090.

@normanmaurer normanmaurer merged commit 7f5e774 into 4.1 Jul 3, 2018
@normanmaurer normanmaurer deleted the native_shading_fix branch July 3, 2018 05:05
@normanmaurer
Copy link
Member Author

I will work on a integration test for this one so we will not break it again

datagramSocketAddrMethodId = (*env)->GetMethodID(env, datagramSocketAddressClass, "<init>", "(Ljava/lang/String;IILio/netty/channel/unix/DatagramSocketAddress;)V");

// Respect shading...
char parameters[1024] = {0};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be safer to calculate the length instead of using an arbitrary size?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could... that said if 1024 is not enough I would be really surprised

Copy link
Contributor

@johnou johnou Jul 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking in terms of buffer overflow but I assume snprintf guards against that? couldn't we do a simple check that nettyClassName does not exceed 1024 and if it does, throw illegalargumentexception just to be on the safe side?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cchantep
Copy link

cchantep commented Jul 3, 2018

@normanmaurer do you know whether it's published on snapshot repo ? To check with CI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants