View Issue Details

IDProjectCategoryView StatusLast Update
0005643unrealmodule apipublic2020-05-17 08:08
Reporterk4be Assigned Tosyzop  
PrioritynormalSeveritycrashReproducibilityalways
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; }

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

MOD_LOAD(){
        return MOD_FAILED;
}
TagsNo tags attached.
3rd party modules

Activities

syzop

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.

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