initialize array 70/128670/2
authorHaejeong Kim <backto.kim@samsung.com>
Thu, 11 May 2017 04:38:48 +0000 (13:38 +0900)
committerHaejeong Kim <backto.kim@samsung.com>
Thu, 11 May 2017 04:40:31 +0000 (13:40 +0900)
Change-Id: Ic10602f97435d0f254a953d9bea26955a897aa93

src/media_db.c
src/media_group.c
src/media_info.c
src/media_playlist.c
src/media_storage.c
src/media_tag.c

index 7927d57..4733ef4 100755 (executable)
@@ -460,8 +460,8 @@ int _media_db_get_media_group(media_group_e group, filter_h filter, media_group_
 int _media_db_get_media_group_and_count(media_group_e group, filter_h filter, media_group_and_count_cb callback, void *user_data)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
-       char select_query[DEFAULT_QUERY_SIZE];
-       char group_query[DEFAULT_QUERY_SIZE];
+       char select_query[DEFAULT_QUERY_SIZE] = {0, };
+       char group_query[DEFAULT_QUERY_SIZE] = {0, };
        char *condition_query = NULL;
        char *option_query = NULL;
        char *name = NULL;
@@ -1454,7 +1454,7 @@ int _media_db_get_media_group_item(const char *group_name, filter_h filter, medi
 int _media_db_get_storage(filter_h filter, media_storage_cb callback, void *user_data)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
-       char select_query[DEFAULT_QUERY_SIZE];
+       char select_query[DEFAULT_QUERY_SIZE] = {0, };
        char *condition_query = NULL;
        char *option_query = NULL;
        sqlite3_stmt *stmt = NULL;
@@ -1506,7 +1506,7 @@ int _media_db_get_storage(filter_h filter, media_storage_cb callback, void *user
 int _media_db_get_pvr_group_item(const char *group_name, filter_h filter, media_group_e group, media_pvr_cb callback, void *user_data)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
-       char select_query[DEFAULT_QUERY_SIZE];
+       char select_query[DEFAULT_QUERY_SIZE] = {0, };
        char *tmp_query = NULL;
        char *condition_query = NULL;
        char *option_query = NULL;
@@ -1735,7 +1735,7 @@ void _media_pvr_item_get_detail(sqlite3_stmt* stmt, media_pvr_h pvr)
 int _media_db_get_pvr(filter_h filter, media_pvr_cb callback, void *user_data)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
-       char select_query[DEFAULT_QUERY_SIZE];
+       char select_query[DEFAULT_QUERY_SIZE] = {0, };
        char *condition_query = NULL;
        char *option_query = NULL;
        sqlite3_stmt *stmt = NULL;
@@ -1867,7 +1867,7 @@ void _media_uhd_item_get_detail(sqlite3_stmt* stmt, media_uhd_h uhd)
 int _media_db_get_uhd(filter_h filter, media_uhd_cb callback, void *user_data)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
-       char select_query[DEFAULT_QUERY_SIZE];
+       char select_query[DEFAULT_QUERY_SIZE] = {0, };
        char *condition_query = NULL;
        char *option_query = NULL;
        sqlite3_stmt *stmt = NULL;
index eea6b58..f4dc52d 100755 (executable)
@@ -78,7 +78,7 @@ int media_album_get_album_from_db(int album_id, media_album_h *album)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
        sqlite3_stmt *stmt = NULL;
-       char select_query[DEFAULT_QUERY_SIZE];
+       char select_query[DEFAULT_QUERY_SIZE] = {0, };
 
        if (album_id < 0) {
                media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
index c9f3992..b4e8199 100755 (executable)
@@ -2396,7 +2396,7 @@ int media_info_set_played_position(media_info_h media, int played_position)
 int media_info_get_media_from_db(const char *media_id, media_info_h *media)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
-       char select_query[DEFAULT_QUERY_SIZE];
+       char select_query[DEFAULT_QUERY_SIZE] = {0, };
        char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0, };
        sqlite3_stmt *stmt = NULL;
 
index c2f2c84..39dbf19 100755 (executable)
@@ -100,7 +100,7 @@ static int __media_playlist_insert_item_to_playlist(int playlist_id, const char
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
        sqlite3_stmt *stmt = NULL;
-       char select_query[DEFAULT_QUERY_SIZE];
+       char select_query[DEFAULT_QUERY_SIZE] = {0, };
        char *query_str = NULL;
        int play_order = 0;
 
@@ -492,7 +492,7 @@ int media_playlist_get_playlist_from_db(int playlist_id, media_playlist_h *playl
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
        sqlite3_stmt *stmt = NULL;
-       char select_query[DEFAULT_QUERY_SIZE];
+       char select_query[DEFAULT_QUERY_SIZE] = {0, };
 
        if (playlist_id > 0) {
                memset(select_query, 0x00, sizeof(select_query));
@@ -595,7 +595,7 @@ int media_playlist_get_play_order(media_playlist_h playlist, int playlist_member
        media_playlist_s *_playlist = (media_playlist_s*)playlist;
        int playlist_id = 0;
        sqlite3_stmt *stmt = NULL;
-       char select_query[DEFAULT_QUERY_SIZE];
+       char select_query[DEFAULT_QUERY_SIZE] = {0, };
 
        if ((_playlist == NULL) || (playlist_member_id < 0) || (play_order == NULL)) {
                media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
index 5664285..d3f31c0 100755 (executable)
@@ -32,7 +32,7 @@ static void __media_storage_get_detail(sqlite3_stmt* stmt, media_storage_h stora
 int media_storage_get_storage_info_from_db(const char *storage_id, media_storage_h *storage)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
-       char select_query[DEFAULT_QUERY_SIZE];
+       char select_query[DEFAULT_QUERY_SIZE] = {0, };
        sqlite3_stmt *stmt = NULL;
 
        if (!STRING_VALID(storage_id) || (storage == NULL)) {
index 6579683..1d72ae3 100755 (executable)
@@ -304,7 +304,7 @@ int media_tag_get_tag_from_db(int tag_id, media_tag_h *tag)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
        sqlite3_stmt *stmt = NULL;
-       char select_query[DEFAULT_QUERY_SIZE];
+       char select_query[DEFAULT_QUERY_SIZE] = {0, };
 
        if (tag_id <= 0) {
                media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);