teamspeak2 plugin: Fix out-of-bounds access to two arrays.
authorRené Rebe <rene@exactcode.de>
Tue, 13 May 2008 08:11:00 +0000 (10:11 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Tue, 13 May 2008 09:59:12 +0000 (11:59 +0200)
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 <octo@huhu.verplant.org>
src/teamspeak2.c

index b7992d8..52a1007 100644 (file)
@@ -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)