From: Tedd Ho-Jeong An Date: Fri, 18 Feb 2022 19:46:17 +0000 (-0800) Subject: gobex: Fix read from pointer after free X-Git-Tag: accepted/tizen/unified/20230608.164325~354 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb3bb108605b26570963aba391fa808ca49d594a;p=platform%2Fupstream%2Fbluez.git gobex: Fix read from pointer after free This patch sets the pointer to null after free since the g_free(p) doesn't set the pointer to NULL. This is reported by the Coverity. Fixes: 7e7d826aa1db ("gobex: Print error if data cannot be written") Signed-off-by: Manika Shrivastava Signed-off-by: Ayush Garg --- diff --git a/gobex/gobex.c b/gobex/gobex.c index e2916e2..0c35af9 100644 --- a/gobex/gobex.c +++ b/gobex/gobex.c @@ -471,6 +471,8 @@ encode: check_srm_final(obex, obex->tx_buf[0] & ~FINAL_BIT); pending_pkt_free(p); + /* g_free() doesn't set the pointer to NULL */ + p = NULL; } obex->tx_data = len;