[PATCH 3/4] 9p: p9dirent_read: check network-provided name length

2018-09-07 Thread Dominique Martinet
From: Dominique Martinet strcpy to dirent->d_name could overflow the buffer, use strscpy to check the provided string length and error out if the size was too big. While we are here, make the function return an error when the pdu parsing failed, instead of returning the pdu offset as if it had

[PATCH 3/4] 9p: p9dirent_read: check network-provided name length

2018-09-07 Thread Dominique Martinet
From: Dominique Martinet strcpy to dirent->d_name could overflow the buffer, use strscpy to check the provided string length and error out if the size was too big. While we are here, make the function return an error when the pdu parsing failed, instead of returning the pdu offset as if it had