Fix invocations of LOG missing format string argument 91/30091/2
authorRafal Krypa <r.krypa@samsung.com>
Mon, 10 Nov 2014 12:43:59 +0000 (13:43 +0100)
committerLukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Mon, 10 Nov 2014 16:39:42 +0000 (08:39 -0800)
commitaaf46e4b88c42b633e731d526010ebe2a5197b42
tree9d484ab817c45b0f71cf485f389d2c9ea1fcaa80
parent626099ee7f86f15d9d1e62826ecca418598e3a6c
Fix invocations of LOG missing format string argument

First argument of LOG* macros is passed to sd_journal_print() as format string.
In some places these macros were used with no format string at all, simply
passing e.what() from an exception. This could lead to a format string
vulnerability in the code, potentially allowing arbitrary code execution.
This error also caused build break:

In file included from /data/src/tizen/cynara/src/client/api/client-api.cpp:27:0:
/data/src/tizen/cynara/src/common/exceptions/TryCatch.h: In function
    ‘int Cynara::tryCatch(const std::function<int()>&)’:
    /data/src/tizen/cynara/src/common/exceptions/TryCatch.h:41:178: error:
    format not a string literal and no format arguments [-Werror=format-security]
         LOGE(e.what());
(... and more ...)

Change-Id: I1259283cf1bd2fa0fb2d271e38a7b416e17939f7
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
src/admin/api/admin-api.cpp
src/client-async/api/client-async-api.cpp
src/client/api/client-api.cpp
src/common/exceptions/TryCatch.h