fix wrong memory usage in buildAndsendSetupRequest 47/5147/1
authorByonggon Chun <bg.chun@samsung.com>
Wed, 18 Nov 2020 06:31:04 +0000 (15:31 +0900)
committerByonggon Chun <bg.chun@samsung.com>
Wed, 25 Nov 2020 01:39:10 +0000 (10:39 +0900)
commit51885f3a5e963b24ed93385817ba8262b9cfd162
tree6dd279e79df298965d5ce2ef035e2e03476b84e6
parentcae9bd5d702e2f74539407699a63a72e5d105f0e
fix wrong memory usage in buildAndsendSetupRequest

Summary
- The function is supposed to re-allocate memory to increase buffer size,
when larger buffer is required to encode the given asn data,
but current impl doesn't do that, so it will lead us to seg fault or memory corruption.

Changes
- make the function to allocate memory in heap for asn encoding buffer rather than stack
- make the function to re-allocate memory when encoded data is larger than the given buffer
- free allocated memory

Issue-ID: RIC-697
Change-Id: I8862f1ee6bff27f898778ae896f8b41830ad6daa
Signed-off-by: Byonggon Chun <bg.chun@samsung.com>
RIC-E2-TERMINATION/sctpThread.cpp