From f4e6ea6ef276390e71e875d7063950f881fefbb5 Mon Sep 17 00:00:00 2001 From: wu zheng Date: Wed, 14 Jan 2015 14:59:23 +0800 Subject: [PATCH] Fix the remaining Security Static Code Analysis Fix Bug-Tizen: TC-2072 Change-Id: I05bded3b341d718a5d44950923dd7fcc30a520c2 Signed-off-by: Wu Zheng --- obexd/plugins/pbap.c | 2 +- tools/hcitool.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/obexd/plugins/pbap.c b/obexd/plugins/pbap.c index c3b79d5..99355cf 100644 --- a/obexd/plugins/pbap.c +++ b/obexd/plugins/pbap.c @@ -426,7 +426,7 @@ static void cache_entry_done(void *user_data) { struct pbap_session *pbap = user_data; const char *id; - int ret; + int ret = 0; DBG(""); diff --git a/tools/hcitool.c b/tools/hcitool.c index 59102f9..ee810e5 100644 --- a/tools/hcitool.c +++ b/tools/hcitool.c @@ -2385,8 +2385,9 @@ failed: static int print_advertising_devices(int dd, uint8_t filter_type) { - unsigned char buf[HCI_MAX_EVENT_SIZE] = {0}; - unsigned char *ptr; + unsigned char buf_array[HCI_MAX_EVENT_SIZE] = {0}; + unsigned char *buf = buf_array; + unsigned char *ptr = NULL; struct hci_filter nf, of; struct sigaction sa; socklen_t olen; @@ -2413,9 +2414,10 @@ static int print_advertising_devices(int dd, uint8_t filter_type) sigaction(SIGINT, &sa, NULL); while (1) { - evt_le_meta_event *meta; - le_advertising_info *info; - char addr[18]; + evt_le_meta_event *meta = NULL; + le_advertising_info *info = NULL; + char addr_array[18]; + char *addr = addr_array; while ((len = read(dd, buf, sizeof(buf))) < 0) { if (errno == EINTR && signal_received == SIGINT) { @@ -2439,7 +2441,8 @@ static int print_advertising_devices(int dd, uint8_t filter_type) /* Ignoring multiple reports */ info = (le_advertising_info *) (meta->data + 1); if (check_report_filter(filter_type, info)) { - char name[30]; + char name_array[30]; + char *name = name_array; memset(name, 0, sizeof(name)); -- 2.7.4