fix prevent violation
authorwoojin <woojin2.jung@samsung.com>
Sat, 20 Apr 2013 12:23:16 +0000 (21:23 +0900)
committerwoojin <woojin2.jung@samsung.com>
Sat, 20 Apr 2013 12:23:16 +0000 (21:23 +0900)
Change-Id: Iac68245a38124f4b01892938bfbd445ac134e1c5

NOTICE
helper/dacapture.c
helper/libdaprobe.c
probe_badaapi/bada_thread.cpp

diff --git a/NOTICE b/NOTICE
index e492808..9ae1cd0 100644 (file)
--- 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.
index a97d351..6e2330e 100755 (executable)
@@ -311,6 +311,7 @@ int captureScreen()
        probeBlockStart();
 
        setProbePoint(&probeInfo);
+       sdata.ximage = NULL;
        scrimage = captureScreenShotX(&width, &height, &sdata);
        if(scrimage != NULL)
        {
index 8178a66..4a353c6 100755 (executable)
@@ -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)
index 1c35b53..7a5bdcb 100755 (executable)
@@ -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();
                }