Fix Prevent issue 27952: String not null terminated
authorDowon Park <dowon.park@samsung.com>
Tue, 8 Jan 2013 07:03:52 +0000 (16:03 +0900)
committerDowon Park <dowon.park@samsung.com>
Tue, 8 Jan 2013 07:03:52 +0000 (16:03 +0900)
Change-Id: I538ee48b35f9cd56f6b2709e88b9c10961cebb9b

viewer/smil-player/src/msg-smil-text-render.c

index c0b8ae3..0785240 100755 (executable)
@@ -66,13 +66,12 @@ MSG_BOOL _msg_smil_render_show_inserted_text(SMIL_RENDERER_DATA_S *viewerRenderD
                                fclose(fp);
                                return FALSE;
                        } else {
-                               char buf[3001] = {0,};          //maximum page text size buf
-                               int result = fread(buf, sizeof(char), stat_buf.st_size, fp);
+                               int result = fread(viewerRenderData->viewer_body_text, sizeof(char), stat_buf.st_size, fp);
                                if (result != stat_buf.st_size) {
                                        MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "fread is failed result : %d", result);
                                }
-                               strncpy(viewerRenderData->viewer_body_text, buf, stat_buf.st_size);
                        }
+
                        MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "viewer_body_text : (%s)", (char *)viewerRenderData->viewer_body_text);
 
                        if (viewerRenderData->viewer_body_text[0] != '\0') {