um,ethertap: use strncpy
authorAlan <gnomes@lxorguk.ukuu.org.uk>
Wed, 8 Apr 2015 12:59:21 +0000 (13:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 May 2015 19:24:35 +0000 (12:24 -0700)
[um maintainers appear to be vanished]

I can't prove the case pointed out in
https://bugzilla.kernel.org/show_bug.cgi?id=82341
is correct so let us play safe.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/um/os-Linux/drivers/ethertap_user.c

index b39b669..6d49182 100644 (file)
@@ -105,7 +105,7 @@ static int etap_tramp(char *dev, char *gate, int control_me,
        sprintf(data_fd_buf, "%d", data_remote);
        sprintf(version_buf, "%d", UML_NET_VERSION);
        if (gate != NULL) {
-               strcpy(gate_buf, gate);
+               strncpy(gate_buf, gate, 15);
                args = setup_args;
        }
        else args = nosetup_args;