View Issue Details

IDProjectCategoryView StatusLast Update
0005643unrealmodule apipublic2020-06-27 13:09
Reporterk4be Assigned Tosyzop  
Status confirmedResolutionopen 
Product Version5.0.4 
Summary0005643: Moddata serialize function is called for modules that failed to load
DescriptionA module can request request client moddata with sync enabled and provided serialize and unserialize functions inside the MOD_INIT call. If the later MOD_LOAD fails, the moddata remains registered, resulting in a crash during server linking when unavailable code for serialize function is called.
Steps To ReproduceThis code should cause the problem:

char *test_serialize(ModData *m){ return NULL; }
void test_unserialize(char *str, ModData *m){ return; }
void test_free(ModData *m){ return; }

    ModDataInfo mreq;
    memset(&mreq, 0, sizeof(mreq));
    mreq.type = MODDATATYPE_CLIENT; = "test";
    mreq.sync = 1; = test_free;
    mreq.serialize = test_serialize;
    mreq.unserialize = test_unserialize;
    ModDataAdd(modinfo->handle, mreq);
    return MOD_SUCCESS;

        return MOD_FAILED;
TagsNo tags attached.
3rd party modules



2020-04-24 19:48

administrator   ~0021524

Crash also occurs if you return MOD_FAILED from MOD_INIT after moddata registration. I will look into it.


2020-06-26 17:01

administrator   ~0021651

Not sure if I will be able to fix this soon.
k4be: would it be possible for you to change the geoip-base module for now, to check the file existence checks to config_posttest? So rather than failing in MOD_LOAD, fail in config posttest instead.
The reason I ask is that pretty much nobody is hitting this bug EXCEPT for users who are using geoip-base, about one user every 2 weeks, which is a bit of a shame.

Otherwise you (and those poor users) will have to wait until I fix the general problem, but that might not even be this year. Fixing these type of bugs can easily introduce more bugs and I would like to keep things stable :)


2020-06-27 13:09

developer   ~0021652

I have updated the module.

Issue History

Date Modified Username Field Change
2020-04-21 11:51 k4be New Issue
2020-04-24 19:48 syzop Note Added: 0021524
2020-04-24 19:49 syzop Assigned To => syzop
2020-04-24 19:49 syzop Status new => confirmed
2020-05-05 08:53 syzop Severity minor => crash
2020-06-26 17:01 syzop Note Added: 0021651
2020-06-27 13:09 k4be Note Added: 0021652