usb: gadget: tcm_usb_gadget: stop format strings
PATCH v2 1/1 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 <[email protected]>
---
v2:
- with stable cc; Felipe Balbi.
--- drivers/usb/gadget/tcm_usb_gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/tcm_usb_gadget.c +1 -1
@@ -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; }
Signature · 6 lines
1.7.9.5 -- Kees Cook Chrome OS Security