Describe the bug
Starting from the line:
} else if (rdbtype == RDB_TYPE_MODULE || rdbtype == RDB_TYPE_MODULE_2) {
Most of the error messages are saying something like "module... %s", where the string is name. However, this string is not the module name but the name of the type registered by the module as moduleTypeNameByID(name,moduleid) is called in most places.
In addition to that the line printing:
serverLog(LL_WARNING,"The RDB file contains module data for the module '%s' that is not terminated by the proper module value EOF marker", name);
prints random garbage because moduleTypeNameByID(name,moduleid) is not called and name is not initialized.
To reproduce
I don't know how I ended up having a corrupted RDB file but in theory it should be reproducible by writing a minimal module that writes something that it never reads.
Expected behavior
The error messages should say either "module type" or actually use the module name or print both.
Additional information
-