usb: gadget: f_fs: Fix out-of-bounds string access
At the end of ffs_epfiles_create() a message is logged with
the name of the epfile, however this epfile pointer is only
valid in the body of the preceding for-loop. After the loop
exits, it is now pointing one past the allocated array and
results in an out-of-bounds memory access when formatting
the string.
Since there could be multiple ep's created, the name may not
be important to log. Replace it with the count instead. Also
while ffs_epfiles_destroy() doesn't have the same problem,
do the same there anyway for symmetry.
Change-Id: I10551f9c1e056f215ec59335cbf1cde2bad6cc04
Signed-off-by: Jack Pham <jackp@codeaurora.org>
1 file changed