fix bugs which are reported by Svace 46/52046/1
authorEunhae Choi <eunhae1.choi@samsung.com>
Wed, 18 Nov 2015 11:57:04 +0000 (20:57 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Wed, 18 Nov 2015 11:57:15 +0000 (20:57 +0900)
Change-Id: I1ddf456d600a5c0401b88dcc00a422d918b70523

src/mm_player_ini.c
src/server/mm_player_priv.c

index f862be9..e5403a6 100644 (file)
@@ -50,11 +50,11 @@ do \
                ( strlen( str ) > 0 ) && \
                ( strlen( str ) < PLAYER_INI_MAX_STRLEN ) ) \
        { \
-               strcpy ( x_item, str ); \
+               strncpy ( x_item, str, PLAYER_INI_MAX_STRLEN-1 ); \
        } \
        else \
        { \
-               strcpy ( x_item, x_default ); \
+               strncpy ( x_item, x_default, PLAYER_INI_MAX_STRLEN-1 ); \
        } \
 }while(0)
 
index 8d20b9d..da8fc59 100644 (file)
@@ -8706,7 +8706,7 @@ static int __mmfplayer_parse_profile(const char *uri, void *param, MMPlayerParse
        {
                if (strlen(path))
                {
-                       strcpy(data->uri, uri);
+                       strncpy(data->uri, uri, MM_MAX_URL_LEN-1);
                        data->uri_type = MM_PLAYER_URI_TYPE_MS_BUFF;
                        ret = MM_ERROR_NONE;
                }
@@ -12480,7 +12480,7 @@ __mmplayer_activate_next_source(mm_player_t *player, GstState target)
 ERROR:
        MMPLAYER_PLAYBACK_UNLOCK(player);
 
-       if (!player->msg_posted)
+       if (player && !player->msg_posted)
        {
                MMPLAYER_POST_MSG(player, MM_MESSAGE_ERROR, &msg_param);
                player->msg_posted = TRUE;