Fix coverity issue 92/155392/1 accepted/tizen_5.0_unified accepted/tizen_5.5_unified accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix tizen_5.0 tizen_5.5 tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix accepted/tizen/5.0/unified/20181102.012308 accepted/tizen/5.5/unified/20191031.014701 accepted/tizen/5.5/unified/mobile/hotfix/20201027.081842 accepted/tizen/5.5/unified/wearable/hotfix/20201027.123209 accepted/tizen/unified/20171018.165401 submit/tizen/20171017.041948 submit/tizen_5.0/20181101.000001 submit/tizen_5.5/20191031.000001 submit/tizen_5.5_mobile_hotfix/20201026.185101 submit/tizen_5.5_wearable_hotfix/20201026.184301 tizen_5.5.m2_release
authorjh8801.jung <jh8801.jung@samsung.com>
Fri, 13 Oct 2017 05:33:22 +0000 (14:33 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Fri, 13 Oct 2017 05:36:17 +0000 (05:36 +0000)
Signed-off-by: jh8801.jung <jh8801.jung@samsung.com>
Change-Id: Ie739ad173723484877cc8164902d14fd85345416

src/oem/oem_emul.c

index c6c915c..3b8a125 100755 (executable)
@@ -637,7 +637,7 @@ static int _net_nfc_create_records_from_emulMsg(emulMsg_s *emul_msg, ndef_messag
                char *record_payload;
 
                emulMsg_data_s record = { 0, };
-               data_s filePayload;
+               data_s filePayload = { NULL, 0 };
 
                /* parse string */
                if (index == 0)
@@ -1598,12 +1598,12 @@ static void emul_ReaderThread(void * pArg)
                                condition = 0;
                        } else if (emulMsg_poll_events[index].events & EPOLLIN) {
                                if (emulMsg_poll_events[index].data.fd == emulMsg_file_fd) {
-                                       char readbuffer[READ_BUFFER_LENGTH_MAX];
+                                       char readbuffer[READ_BUFFER_LENGTH_MAX + 1];
                                        int readcnt = 0;
 
                                        DEBUG_MSG("precess POLLIN ");
 
-                                       memset(readbuffer, 0x00, sizeof(READ_BUFFER_LENGTH_MAX));
+                                       memset(readbuffer, 0x00, sizeof(READ_BUFFER_LENGTH_MAX) + 1);
 
                                        readcnt = read(emulMsg_file_fd, readbuffer, READ_BUFFER_LENGTH_MAX);