sdpd: Fix leaking buffers stored in cstates cache
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 15 Jul 2021 18:01:20 +0000 (11:01 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:37 +0000 (19:08 +0530)
commit8b7b720cdca830425e9067aae836e417a1ed23dd
treea06b53e86e5d4345f05d1edfbe157a49ce792bfc
parent1d125a1c55a743740c4d19bc33e271d6ccb25ffd
sdpd: Fix leaking buffers stored in cstates cache

These buffer shall only be keep in cache for as long as they are
needed so this would cleanup any client cstates in the following
conditions:

 - There is no cstate on the response
 - No continuation can be found for cstate
 - Different request opcode
 - Respond with an error
 - Client disconnect

Fixes: https://github.com/bluez/bluez/security/advisories/GHSA-3fqg-r8j5-f5xq
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/sdpd-request.c
src/sdpd-server.c
src/sdpd.h
unit/test-sdp.c