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

java: add CopyFromBuffer helper and ensure the properly sized ByteBuffer is used #551

Merged
merged 2 commits into from
Oct 9, 2020

Conversation

axic
Copy link
Member

@axic axic commented Oct 9, 2020

No description provided.

@axic axic marked this pull request as draft October 9, 2020 16:36
@axic axic force-pushed the java-execute-ensure-buffer branch from d02c772 to 37370ab Compare October 9, 2020 16:39
@@ -88,6 +88,10 @@ JNIEXPORT void JNICALL Java_org_ethereum_evmc_EvmcVm_execute(JNIEnv* jenv,
jint jcode_size,
jobject jresult)
{
jint rs = evmc_java_set_jvm(jenv);
Copy link
Member Author

Choose a reason for hiding this comment

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

This is part of another PR. We should actually pass down the jenv via the context.

@axic axic force-pushed the java-execute-ensure-buffer branch from 37370ab to 4aee303 Compare October 9, 2020 16:40
@axic
Copy link
Member Author

axic commented Oct 9, 2020

@atoulme @jrhea this is likely the reason you got crashes. The code was doing an unchecked copying of whatever was passed.

@axic axic marked this pull request as ready for review October 9, 2020 16:49
@axic axic requested review from chfast, jrhea and atoulme and removed request for chfast October 9, 2020 16:50
@axic axic force-pushed the java-execute-ensure-buffer branch from 9386886 to ba1407c Compare October 9, 2020 16:50
Copy link
Collaborator

@atoulme atoulme left a comment

Choose a reason for hiding this comment

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

👍

@axic axic force-pushed the java-execute-ensure-buffer branch 2 times, most recently from 0e15954 to beeddcb Compare October 9, 2020 17:04
@axic axic changed the base branch from java-host-context to master October 9, 2020 17:05
@axic axic force-pushed the java-execute-ensure-buffer branch from beeddcb to fe5420f Compare October 9, 2020 17:07
@axic axic merged commit 57bbfb5 into master Oct 9, 2020
@axic axic deleted the java-execute-ensure-buffer branch October 9, 2020 19:20
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.

2 participants