Addition to DLL loading code?

sciogoon at gmail.com sciogoon at gmail.com
Sun Jul 15 19:49:52 EDT 2007


There is a bug when searching for a loadable DLL. When looking for a
DLL, Sys_LoadDll searches the current game folders of basepath and
cdpath for it, and if not found, it loads the QVM.

But that is basically how it supposed to work, isn't it? Yes, but
consider what happens, when a mod doesn't have it's own cgame.qvm.

The client connects to the server, and sets fs_game from 'baseq3' to
what mod it has to, let's say 'myMod'. There is no pk3 to download,
because myMod is a server-side mod. OK, time to load. Start with
loading the DLL (sv_pure is off). Can a DLL be found for the mod
called myMod? Searching cgamex86.dll in [ basepath | cdpath ]/myMod/
... not found. Proceeding to load a QVM. Searching cgamex86.dll in [
basepath | cdpath ]/myMod/ ... not found, just as with the DLL. The
QVM search continues, this time not with myMod, but with baseq3. QVM
found, loading.

In this scenario, the QVM that has been loaded should have been
replaced by the DLL for the same mod, baseq3. So even when we have
native code for a give mod, the interpreter will be loaded in the
presence of a server side mod.

So to fix this I would search all paths for the DLL and the QVM, and
if a DLL could be loaded for the same mod, go ahead and try to load
it.

I would also search the homepath for DLLs. What's wrong with that? Can
files with a .DLL extension be downloaded, and that posseses threats?



More information about the quake3 mailing list