Fix crash when unloading the arcfour module
Remove the empty Arcfour_Cleanup() function so that the default module cleanup can happen. Define MODULE_NAME and use that when registering the module callbacks so that the default module cleanup will remove them correctly.
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
[Changes 1.2.2]
|
[Changes 1.2.2]
|
||||||
|
|
||||||
|
* Fix crash when unloading the arcfour module. (caf)
|
||||||
|
|
||||||
* Change add_dcc_bind() to collect all function pointer arguments into a
|
* Change add_dcc_bind() to collect all function pointer arguments into a
|
||||||
single struct. (caf)
|
single struct. (caf)
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
#define INIT_MODULE
|
#define INIT_MODULE
|
||||||
#include "modval.h"
|
#include "modval.h"
|
||||||
|
|
||||||
|
#define MODULE_NAME "arcfour"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int sock;
|
int sock;
|
||||||
char ukey[16];
|
char ukey[16];
|
||||||
@@ -120,19 +122,13 @@ int Arcfour_Init(IrcCommandDll **intp, Function_ptr *global_table)
|
|||||||
{
|
{
|
||||||
static const struct dcc_ops schat_ops = { NULL, start_dcc_crypt, dcc_schat_input, send_dcc_encrypt, end_dcc_crypt };
|
static const struct dcc_ops schat_ops = { NULL, start_dcc_crypt, dcc_schat_input, send_dcc_encrypt, end_dcc_crypt };
|
||||||
|
|
||||||
initialize_module("arcfour");
|
initialize_module(MODULE_NAME);
|
||||||
memset(keyboxes, 0, sizeof(keyboxes));
|
memset(keyboxes, 0, sizeof(keyboxes));
|
||||||
typenum = add_dcc_bind("SCHAT", "schat", &schat_ops);
|
typenum = add_dcc_bind("SCHAT", MODULE_NAME, &schat_ops);
|
||||||
add_module_proc(DCC_PROC, "schat", "schat", "Secure DCC Chat", 0, 0, dcc_sdcc, NULL);
|
add_module_proc(DCC_PROC, MODULE_NAME, "SCHAT", "Secure DCC Chat", 0, 0, dcc_sdcc, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Arcfour_Cleanup(IrcCommandDll **intp)
|
|
||||||
{
|
|
||||||
/* remove_dcc_bind("SCHAT", typenum); */
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static arclist *find_box(int sock)
|
static arclist *find_box(int sock)
|
||||||
{
|
{
|
||||||
int i, tmp;
|
int i, tmp;
|
||||||
|
|||||||
Reference in New Issue
Block a user