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

Update lib_mysqludf_sys.c #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

wa5620
Copy link

@wa5620 wa5620 commented Mar 3, 2020

There is big bug for sys_eval which could make crash for mysql.
in char* sys_eval()
Parameter char* result is a fixed char[256] provied by framework. can not be realloc.
We could alloc bigger memory by ourself and free it at sys_eval_deinit().

There is a bug for sys_eval which could make crash for mysql.
in char* sys_eval()
Parameter char* result is a fixed char[256] provied by framework. can not be realloc.
We could alloc bigger memory by ourself and free it at sys_eval_deinit().
@R31N3
Copy link

R31N3 commented May 14, 2020

I tried this fork on my server, now it doesn't crash, but there's no result too, just NULL. I tried something like:
SELECT sys_eval('curl https://google.com') as result;

Without your fix it worked currec half the time, sometimes worked, sometimes crashed.

@wa5620
Copy link
Author

wa5620 commented May 14, 2020

I tried this fork on my server, now it doesn't crash, but there's no result too, just NULL. I tried something like:
SELECT sys_eval('curl https://google.com') as result;

Without your fix it worked currec half the time, sometimes worked, sometimes crashed.

May you try debug little bit, to see where the problem is.
The code works fine on my server Redhat73 mysql5.7 for a long time.

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