Skip to content
Permalink
Browse files

Fix server/port len

Found by: michaelortmann
Patch by: michaelortmann
  • Loading branch information
michaelortmann authored and vanosg committed Dec 16, 2019
1 parent 73bba4f commit e0bbc9c606483b4a292a0e0391c9eb665643ab52
Showing with 6 additions and 14 deletions.
  1. +1 −1 src/main.c
  2. +3 −3 src/mod/server.mod/server.c
  3. +0 −8 src/mod/server.mod/server.h
  4. +2 −2 src/mod/server.mod/tclserv.c
@@ -1066,7 +1066,7 @@ int main(int arg_c, char **arg_v)
egg_snprintf(egg_version, sizeof egg_version, "%s+%s %u", EGG_STRINGVER, EGG_PATCH, egg_numver);
egg_snprintf(ver, sizeof ver, "eggdrop v%s+%s", EGG_STRINGVER, EGG_PATCH);
egg_snprintf(version, sizeof version,
"Eggdrop v%s+%s (C) 1997 Robey Pointer (C) 2010-2018 Eggheads",
"Eggdrop v%s+%s (C) 1997 Robey Pointer (C) 2010-2019 Eggheads",
EGG_STRINGVER, EGG_PATCH);
#else
egg_snprintf(egg_version, sizeof egg_version, "%s %u", EGG_STRINGVER, egg_numver);
@@ -997,11 +997,11 @@ static void queue_server(int which, char *msg, int len)
removed from Eggdrop.
*/
static void old_add_server(const char *ss) {
char name[121] = "";
char name[256] = "";
char port[7] = "";
char pass[121] = "";
if (!sscanf(ss, "[%255[0-9.A-F:a-f]]:%10[+0-9]:%120[^\r\n]", name, port, pass) &&
!sscanf(ss, "%255[^:]:%10[+0-9]:%120[^\r\n]", name, port, pass))
if (!sscanf(ss, "[%255[0-9.A-F:a-f]]:%6[+0-9]:%120[^\r\n]", name, port, pass) &&
!sscanf(ss, "%255[^:]:%6[+0-9]:%120[^\r\n]", name, port, pass))
return;
add_server(name, port, pass);
}
@@ -83,14 +83,6 @@
#define addserver ((void(*)(char *))server_funcs[41])
#define delserver ((void(*)(char *))server_funcs[42])
#define net_type_int (*(int *)(server_funcs[43]))
#else /* MAKING_SERVER */

/* Macros for commonly used commands. */
#define free_null(ptr) do { \
nfree(ptr); \
ptr = NULL; \
} while (0)

#endif /* MAKING_SERVER */

struct server_list {
@@ -334,7 +334,7 @@ static int tcl_queuesize STDVAR
}

static int tcl_addserver STDVAR {
char name[121] = "";
char name[256] = "";
char port[7] = "";
char pass[121] = "";
char ret = 0;
@@ -362,7 +362,7 @@ static int tcl_addserver STDVAR {
}

static int tcl_delserver STDVAR {
char name[121] = "";
char name[256] = "";
char port[7] = "";
char ret = 0;

0 comments on commit e0bbc9c

Please sign in to comment.
You can’t perform that action at this time.