diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-12-17 18:55:43 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-12-17 18:55:43 +0000 |
commit | b3027b00fb56b99190b5f83ca1f5bb9a1a0a7c40 (patch) | |
tree | c9ed00db5ba6fc3b871889d68a93978e2aaf278b | |
parent | 354d611659dee2b7fda6576920529f1df5bff617 (diff) |
- Avoid magically sized temporary buffers
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2690 82007160-df01-0410-b94d-b575c5fd34c7
-rw-r--r-- | modules/m_stats.c | 2 | ||||
-rw-r--r-- | modules/m_who.c | 2 | ||||
-rw-r--r-- | src/client.c | 4 | ||||
-rw-r--r-- | src/ircd.c | 6 | ||||
-rw-r--r-- | src/listener.c | 2 | ||||
-rw-r--r-- | src/s_serv.c | 2 | ||||
-rw-r--r-- | src/s_user.c | 2 |
7 files changed, 10 insertions, 10 deletions
diff --git a/modules/m_stats.c b/modules/m_stats.c index 56336c3..b6e56bb 100644 --- a/modules/m_stats.c +++ b/modules/m_stats.c @@ -82,7 +82,7 @@ report_confitem_types(struct Client *source_p, enum maskitem_type type) dlink_node *ptr = NULL; struct MaskItem *conf = NULL; const struct shared_flags *shared = NULL; - char buf[12]; + char buf[IRCD_BUFSIZE]; char *p = NULL; switch (type) diff --git a/modules/m_who.c b/modules/m_who.c index 47c376e..961bb01 100644 --- a/modules/m_who.c +++ b/modules/m_who.c @@ -51,7 +51,7 @@ static void do_who(struct Client *source_p, struct Client *target_p, const char *chname, const char *op_flags) { - char status[8]; /* Gr*@%+\0 */ + char status[IRCD_BUFSIZE]; if (HasUMode(source_p, UMODE_OPER)) snprintf(status, sizeof(status), "%c%s%s%s", target_p->away[0] ? 'G' : 'H', diff --git a/src/client.c b/src/client.c index a28f138..08177a6 100644 --- a/src/client.c +++ b/src/client.c @@ -240,7 +240,7 @@ check_pings(void *notused) static void check_pings_list(dlink_list *list) { - char scratch[32]; /* way too generous but... */ + char scratch[IRCD_BUFSIZE]; int ping = 0; /* ping time value from client */ dlink_node *ptr = NULL, *next_ptr = NULL; @@ -998,7 +998,7 @@ dead_link_on_write(struct Client *client_p, int ierrno) void dead_link_on_read(struct Client *client_p, int error) { - char errmsg[255]; + char errmsg[IRCD_BUFSIZE]; int current_error; if (IsDefunct(client_p)) @@ -173,7 +173,7 @@ static struct lgetopt myopts[] = { void set_time(void) { - static char to_send[200]; + static char to_send[IRCD_BUFSIZE]; struct timeval newtime; newtime.tv_sec = 0; newtime.tv_usec = 0; @@ -328,7 +328,7 @@ write_pidfile(const char *filename) if ((fb = fopen(filename, "w"))) { - char buff[32]; + char buff[IRCD_BUFSIZE]; unsigned int pid = (unsigned int)getpid(); snprintf(buff, sizeof(buff), "%u\n", pid); @@ -357,7 +357,7 @@ static void check_pidfile(const char *filename) { FILE *fb; - char buff[32]; + char buff[IRCD_BUFSIZE]; pid_t pidfromfile; /* Don't do logging here, since we don't have log() initialised */ diff --git a/src/listener.c b/src/listener.c index 1699bba..9b4d681 100644 --- a/src/listener.c +++ b/src/listener.c @@ -84,7 +84,7 @@ get_listener_name(const struct Listener *const listener) void show_ports(struct Client *source_p) { - char buf[6]; + char buf[IRCD_BUFSIZE]; char *p = NULL; dlink_node *ptr; diff --git a/src/s_serv.c b/src/s_serv.c index 97ee59b..8fbf889 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -570,7 +570,7 @@ send_capabilities(struct Client *client_p, int cap_can_send) void sendnick_TS(struct Client *client_p, struct Client *target_p) { - char ubuf[66]; + char ubuf[IRCD_BUFSIZE]; if (!IsClient(target_p)) return; diff --git a/src/s_user.c b/src/s_user.c index 7da24f8..ff77ce1 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -563,7 +563,7 @@ static void introduce_client(struct Client *source_p) { dlink_node *server_node = NULL; - char ubuf[66]; + char ubuf[IRCD_BUFSIZE]; if (MyClient(source_p)) send_umode(source_p, source_p, 0, SEND_UMODES, ubuf); |