Fix message overflow 14/105014/2 submit/tizen_3.0/20161216.045231
authorGihun Chang <gihun.chang@samsung.com>
Thu, 15 Dec 2016 04:56:51 +0000 (13:56 +0900)
committerGihun Chang <gihun.chang@samsung.com>
Fri, 16 Dec 2016 00:05:55 +0000 (09:05 +0900)
Change-Id: Iaa3a46b5d6550e02d3d5ea66d0213e44a2048779

src/TTraceWrapper.cpp
src/ttrace.c

index c926095bfcb9a349e2872fba57b6d05ac0e35d72..7e535e47b38a8878b2102271f8bbd79e75683746 100644 (file)
@@ -23,11 +23,12 @@ TTraceWrapper::TTraceWrapper(uint64_t tags, const char* label, ...) {
        char fmtd_label[MAX_LEN];
 
        tag = tags;
+
        va_start(ap, label);
        vsnprintf(fmtd_label, MAX_LEN, label, ap);
-       
-       traceBegin(tag, fmtd_label);
+       traceBegin(tag, "%s", fmtd_label);
        va_end(ap);
+
 }
 
 TTraceWrapper::~TTraceWrapper() {
index a46758348308c8b907dc31bd310e10bd438d0de0..c2573dc89b507d4d4257953fa7176e1a7a677a4f 100755 (executable)
@@ -155,7 +155,7 @@ void traceBegin(uint64_t tag, const char *name, ...)
                TTRACE_LOG("traceBegin:: write >> tag: %u tag_bit: %u", tag, *cur_enabled_tag);
 
                va_start(ap, name);
-               snprintf(buf, MAX_LEN, "B|%5d|", getpid());
+               snprintf(buf, MAX_HEAD_LEN, "B|%5d|", getpid());
                len += vsnprintf(buf + MAX_HEAD_LEN, POS_LABEL_ST, name, ap);
                va_end(ap);
 
@@ -208,6 +208,7 @@ void traceAsyncBegin(uint64_t tag, int32_t cookie, const char *name, ...)
                va_list ap;
 
                TTRACE_LOG("traceAsyncBegin:: write >> tag: %u tag_bit: %u cookie: %d", tag, *cur_enabled_tag, cookie);
+
                va_start(ap, name);
                snprintf(buf, MAX_LEN, "S|%5d|", getpid());
                len += vsnprintf(buf + MAX_HEAD_LEN, POS_LABEL_ST, name, ap);