From: René Rebe Date: Tue, 13 May 2008 08:11:00 +0000 (+0200) Subject: teamspeak2 plugin: Fix out-of-bounds access to two arrays. X-Git-Tag: collectd-4.4.1~9 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=59ede0a59ff1c409ec04bd38de7d0058639d5aa9;p=collectd.git teamspeak2 plugin: Fix out-of-bounds access to two arrays. Hi, while updating our T2 SDE (http://www.t2-project.org) package I noticed some out-of-bounds acces in the teamspeak2 support: Signed-off-by: Florian Forster --- diff --git a/src/teamspeak2.c b/src/teamspeak2.c index b7992d80..52a1007e 100644 --- a/src/teamspeak2.c +++ b/src/teamspeak2.c @@ -389,7 +389,7 @@ static int tss2_select_vserver (FILE *read_fh, FILE *write_fh, vserver_list_t *v ERROR ("teamspeak2 plugin: tss2_receive_line failed."); return (-1); } - response[sizeof (response)] = 0; + response[sizeof (response) - 1] = 0; /* Check answer */ if ((strncasecmp ("OK", response, 2) == 0) @@ -437,7 +437,7 @@ static int tss2_vserver_gapl (FILE *read_fh, FILE *write_fh, ERROR ("teamspeak2 plugin: tss2_receive_line failed."); return (-1); } - buffer[sizeof (buffer)] = 0; + buffer[sizeof (buffer) - 1] = 0; if (strncmp ("average_packet_loss=", buffer, strlen ("average_packet_loss=")) == 0)