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

orm_load crashing server when there is a NULL field #68

Closed
IstuntmanI opened this issue Sep 17, 2015 · 4 comments
Closed

orm_load crashing server when there is a NULL field #68

IstuntmanI opened this issue Sep 17, 2015 · 4 comments
Assignees
Labels

Comments

@IstuntmanI
Copy link
Contributor

So, as the title says, I just discovered something which looks like a bug (well, it is).

I firstly create an ORM object, then I add an orm_addvar_string (maybe others too, idk, I don't have time to test it too much, but this is how I did it for this specific column) for that ORM id, then when I use orm_load and that field is NULL, the orm_load is processed ok, it shows the debug after it. But when the specified callback has to be called, it isn't even printing the first debug print, because it crashes before the callback is processed.

This is what server outputs:

[17/09/2015 20:47:38] OnPlayerLogin JAJA
[17/09/2015 20:47:38] [debug] Server crashed due to an unknown error
[17/09/2015 20:47:39] [debug] Native backtrace:
[17/09/2015 20:47:39] [debug] #0 00403270 in ?? () from samp-server.exe
[17/09/2015 20:47:39] [debug] #1 65e41c89 in ?? () from plugins\mysql.DLL
[17/09/2015 20:47:39] [debug] #2 00469a46 in ?? () from samp-server.exe
[17/09/2015 20:47:39] [debug] #3 0048d46b in ?? () from samp-server.exe
[17/09/2015 20:47:39] [debug] #4 0049b431 in ?? () from samp-server.exe
[17/09/2015 20:47:39] [debug] #5 0049b441 in ?? () from samp-server.exe

I can't provide a test script, and I don't know if this is an issue only in my gamemode (I am almost sure that this is a bug with the plugin), but this is what I encountered just now. I'm pretty busy ATM.

Can somebody confirm this ?

@maddinat0r
Copy link
Collaborator

Yup, seems like a bug here. There's a null-pointer being passed to amx_SetString (if the field has a NULL value), which probably causes the crash (call stack confirms this).

maddinat0r added a commit that referenced this issue Sep 17, 2015
@maddinat0r maddinat0r added the bug label Sep 17, 2015
@maddinat0r maddinat0r self-assigned this Sep 17, 2015
@maddinat0r
Copy link
Collaborator

Here's a build including that fix: http://en.file-upload.net/download-10917033/mysql.zip.html
(doesn't support Windows XP and requires VS2013 C++ redistributables)
Please report back if the crash still happens.

@IstuntmanI
Copy link
Contributor Author

It is fixed.

@maddinat0r
Copy link
Collaborator

Great 👍

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

No branches or pull requests

2 participants