Parent: cfcc6346a96a9a4c3123ddc5bb395e079efe5205
Author: Jonas Dreßler <verdre@v0yd.nl>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2023-11-13 20:29:56
Tree: be2350002fe359ac10fb98edc22de64f2468b14c
lib/sdp: Use correct string length in sdp_copy_seq() sdp_data_t->unitSize for strings in the SDP record is `sizeof(uint8_t) + strlen(str)`. The "length" argument of sdp_data_alloc_with_length() is expected to be only the length of the string (so `sdp_data_t->unitSize - sizeof(uint8_t)`). Since the last commit, in sdp_copy_seq() we're allocating one byte too much for strings now, because the `sizeof(uint8_t)` is not subtracted from unitSize there. Fix this by making use of the length returned by sdp_data_value() and pass that on to sdp_data_alloc_with_length(). Co-developed-by: Zander Brown <zbrown@gnome.org>
Diffstat
| M | lib/sdp.c | | | 6 | +++- - - |
1 files changed, 3 insertions(+), 3 deletions(-)