mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
usb: gadget: tcm_usb_gadget: stop format strings
commit aba37fd975 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1d06be05aa
commit
fc363768ac
@@ -1614,7 +1614,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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user