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

Stack overflow in cvt.cpp with invalid DSC from UDF [CORE5317] #5593

Open
firebird-automations opened this issue Jul 23, 2016 · 1 comment
Open

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Geoff Worboys (gworboys)

I've marked this down as a UDF related issue because I don't imagine you should get invalid DSC from anywhere else.

If a UDF returns an invalid result "by descriptor" (an invalid DSC) then it is possible for CVT_Move to get called in an attempt to convert the return value. The conversion fails and calls CVT_conversion_error, which can result in a call to CVT_Move (trying to convert to the input to ASCII to give a useful message), but when the DSC is invalid that fails too and so we get infinite recursion and a stack overflow.

I was experimenting with changing the return dsc_type to 0 (unknown) because that apparently used to be a way to indicate an error to the server by causing a conversion error (according to a really old document by Claudio). But all I get now is a stack overflow.

Only reported as minor because, let's face it, the problem actually lies in the UDF. But it would be nice if the server would fail gracefully.

@firebird-automations
Copy link
Collaborator Author

Commented by: Geoff Worboys (gworboys)

I have confirmed that this problem still exists in Firebird v3.0.0 (release version). It was only a very simple test - a UDF returning a paramdsc with a dsc_type of 0 - but it caused a stack overflow error.

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

No branches or pull requests

1 participant