Fix to catch std::bad_array_new_length when allocating array using new 09/318709/1 accepted/tizen/unified/20250204.110442
authorSangYoun Kwak <sy.kwak@samsung.com>
Wed, 22 Jan 2025 11:24:19 +0000 (20:24 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Wed, 22 Jan 2025 11:24:19 +0000 (20:24 +0900)
commit1c7ee94810134a4098d8dca1a7934ae9603ff18f
tree837398458d085d7a7b9b8a068d1f5e933814c50d
parente9074915600532383ca2fe039e8859dbcf6513c6
Fix to catch std::bad_array_new_length when allocating array using new

The exception std::bad_array_new_length is thrown when the size of new
array is negative or too big to allocate.
Also, this exception cannot be suppressed by std::nothrow, so it should
be catched explicitly when allocating array using 'new' with variable
size.
To make code more reliable, try-catch statements are added to the array
allocating codes using 'new' with variable size.

Change-Id: If1d8b3ce57dace4bb4bc1d976394e4be879ac9ca
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
src/client/sensor_internal.cpp
src/client/sensor_listener.cpp
src/client/sensor_provider_channel_handler.cpp
src/server/application_sensor_handler.cpp
src/server/sensor_handler.cpp
src/server/sensor_manager.cpp
src/server/server_channel_handler.cpp