Fix pointer array initialization 05/296705/2 accepted/tizen_8.0_unified accepted/tizen/8.0/unified/20231005.094242 accepted/tizen/unified/20230807.014655 tizen_8.0_m2_release
authorSuyeon Hwang <stom.hwang@samsung.com>
Thu, 3 Aug 2023 07:13:06 +0000 (16:13 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Thu, 3 Aug 2023 08:05:40 +0000 (17:05 +0900)
- Issue:
Buffer overflow can occur when the array is initialized.

- Solution:
This patch uses the zero-initialization for initializing the arrays.
Since C++11, using empty brace sets all value in a array as 0. The
standard names this as zero-initialization. Thus, this patch changes
the initialization using this initialization method.

Change-Id: Ib4362e3db69f2c70cdc16d00ab44303ffbee234b
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
inc/service_config.h

index ace3a2a..ff6620c 100644 (file)
@@ -61,12 +61,12 @@ typedef struct ma_assistant_info_s {
                app_id{nullptr},
                name{nullptr},
                icon_path{nullptr},
-               wakeup_list{0x00, },
-               wakeup_language{0x00, },
+               wakeup_list{},
+               wakeup_language{},
                cnt_wakeup{0},
-               supported_lang{0x00, },
+               supported_lang{},
                cnt_lang{0},
-               wakeup_engine{nullptr, },
+               wakeup_engine{},
                cnt_wakeup_engine{0},
                custom_ui_option{false},
                /* TODO: Define these two default values somewhere else */