Browse Source

usb: gadget: tcm_usb_gadget: stop format strings

This makes sure that the name coming out of configfs cannot be used
accidentally as a format string.

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Kees Cook 11 years ago
parent
commit
aba37fd975
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/usb/gadget/tcm_usb_gadget.c

+ 1 - 1
drivers/usb/gadget/tcm_usb_gadget.c

@@ -1613,7 +1613,7 @@ static struct se_wwn *usbg_make_tport(
 		return ERR_PTR(-ENOMEM);
 	}
 	tport->tport_wwpn = wwpn;
-	snprintf(tport->tport_name, sizeof(tport->tport_name), wnn_name);
+	snprintf(tport->tport_name, sizeof(tport->tport_name), "%s", wnn_name);
 	return &tport->tport_wwn;
 }