From: woojin Date: Sat, 20 Apr 2013 12:23:16 +0000 (+0900) Subject: fix prevent violation X-Git-Tag: submit/tizen_2.2/20130717.151335~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97f7a96e2a339d4730caaa08b00d808bf91730e2;p=framework%2Fsystem%2Fdynamic-analysis-probe.git fix prevent violation Change-Id: Iac68245a38124f4b01892938bfbd445ac134e1c5 --- diff --git a/NOTICE b/NOTICE index e492808..9ae1cd0 100644 --- a/NOTICE +++ b/NOTICE @@ -1,6 +1,6 @@ Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. Except as noted, this software is licensed under Lesser GNU Public License , Version 2.1. -Please, see the LICENSE.LGPLv2.1 file for Apache License terms and conditions. +Please, see the LICENSE.LGPLv2.1 file for Lesser General Public License terms and conditions. Several source codes may have its original copyright owner and/or be licensed under other than Lesser GNU Public License , Version 2.1, say, MIT License. diff --git a/helper/dacapture.c b/helper/dacapture.c index a97d351..6e2330e 100755 --- a/helper/dacapture.c +++ b/helper/dacapture.c @@ -311,6 +311,7 @@ int captureScreen() probeBlockStart(); setProbePoint(&probeInfo); + sdata.ximage = NULL; scrimage = captureScreenShotX(&width, &height, &sdata); if(scrimage != NULL) { diff --git a/helper/libdaprobe.c b/helper/libdaprobe.c index 8178a66..4a353c6 100755 --- a/helper/libdaprobe.c +++ b/helper/libdaprobe.c @@ -87,7 +87,7 @@ static void _configure(char* configstr) } } -// create sokcet to daemon and connect +// create socket to daemon and connect static int createSocket(void) { ssize_t recvlen; @@ -113,9 +113,16 @@ static int createSocket(void) { if(log.length > 0) { + if(log.length >= DA_LOG_MAX) + log.length = DA_LOG_MAX - 1; recvlen = recv(gTraceInfo.socket.daemonSock, log.data, log.length, MSG_WAITALL); } + else + { + log.length = 0; + } + log.data[log.length] = '\0'; if(log.type == MSG_CONFIG) @@ -233,9 +240,16 @@ static void* recvThread(void* data) { if(log.length > 0) { + if(log.length >= DA_LOG_MAX) + log.length = DA_LOG_MAX - 1; recvlen = recv(gTraceInfo.socket.daemonSock, log.data, log.length, MSG_WAITALL); } + else + { + log.length = 0; + } + log.data[log.length] = '\0'; if(log.type == MSG_CONFIG) diff --git a/probe_badaapi/bada_thread.cpp b/probe_badaapi/bada_thread.cpp index 1c35b53..7a5bdcb 100755 --- a/probe_badaapi/bada_thread.cpp +++ b/probe_badaapi/bada_thread.cpp @@ -253,7 +253,7 @@ _ThreadImpl::ThreadProc(void* params) { probeInfo.pID, probeInfo.tID); _ThreadImpl* pSelf =(_ThreadImpl*)params; - const Thread* pThread; + const Thread* pThread = NULL; if(pSelf != null){ pThread = pSelf->GetThread(); } @@ -287,7 +287,7 @@ _ThreadImpl::ThreadProc(void* params) { probeInfo.pID, probeInfo.tID); _ThreadImpl* pSelf =(_ThreadImpl*)params; - const Thread* pThread; + const Thread* pThread = NULL; if(pSelf != null){ pThread = pSelf->GetThread(); }