aboutsummaryrefslogtreecommitdiff
path: root/lib/test-string_helpers.c
diff options
context:
space:
mode:
authorFedor Pchelkin <[email protected]>2023-12-06 23:09:13 +0300
committerDominique Martinet <[email protected]>2023-12-13 05:44:30 +0900
commitff49bf1867578f23a5ffdd38f927f6e1e16796c4 (patch)
tree29bb66d6e7e56da4a7ef5c9d8b7735dde42984e6 /lib/test-string_helpers.c
parenta931c6816078af3e306e0f444f492396ce40de31 (diff)
net: 9p: avoid freeing uninit memory in p9pdu_vreadf
If some of p9pdu_readf() calls inside case 'T' in p9pdu_vreadf() fails, the error path is not handled properly. *wnames or members of *wnames array may be left uninitialized and invalidly freed. Initialize *wnames to NULL in beginning of case 'T'. Initialize the first *wnames array element to NULL and nullify the failing *wnames element so that the error path freeing loop stops on the first NULL element and doesn't proceed further. Found by Linux Verification Center (linuxtesting.org). Fixes: ace51c4dd2f9 ("9p: add new protocol support code") Signed-off-by: Fedor Pchelkin <[email protected]> Message-ID: <[email protected]> Cc: [email protected] Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Christian Schoenebeck <[email protected]> Signed-off-by: Dominique Martinet <[email protected]>
Diffstat (limited to 'lib/test-string_helpers.c')
0 files changed, 0 insertions, 0 deletions