diff options
author | Gu Chaojie <chao.jie.gu@intel.com> | 2014-11-22 09:12:51 +0800 |
---|---|---|
committer | Gu Chaojie <chao.jie.gu@intel.com> | 2014-11-22 09:12:51 +0800 |
commit | 1100e3a228976dacbb6c6fcc29c523dec8ac49ad (patch) | |
tree | d8756c49ddb4b9e07bfd24bcc763d12d27ebb5c4 | |
parent | 6904a21657375bedcd87d01df24ef3087d23cac8 (diff) | |
download | bluez-1100e3a228976dacbb6c6fcc29c523dec8ac49ad.tar.gz bluez-1100e3a228976dacbb6c6fcc29c523dec8ac49ad.tar.bz2 bluez-1100e3a228976dacbb6c6fcc29c523dec8ac49ad.zip |
Fix Security Static Code Analysis
Bug-Tizen: TC-2072
Change-Id: I7e92d05aca928992f185e402d6b3fffd0419584c
Signed-off-by: Gu Chaojie <chao.jie.gu@intel.com>
-rw-r--r-- | obexd/plugins/pbap.c | 4 | ||||
-rw-r--r-- | profiles/network/server.c | 2 | ||||
-rw-r--r-- | src/device.c | 2 | ||||
-rw-r--r-- | tools/hciattach.c | 2 | ||||
-rw-r--r-- | tools/hcitool.c | 3 |
5 files changed, 7 insertions, 6 deletions
diff --git a/obexd/plugins/pbap.c b/obexd/plugins/pbap.c index 79e85ab9..c3b79d54 100644 --- a/obexd/plugins/pbap.c +++ b/obexd/plugins/pbap.c @@ -756,7 +756,7 @@ static void *vobject_list_open(const char *name, int oflag, mode_t mode, { struct pbap_session *pbap = context; struct pbap_object *obj = NULL; - int ret; + int ret = 0; void *request; DBG("name %s context %p valid %d", name, context, pbap->cache.valid); @@ -810,7 +810,7 @@ static void *vobject_vcard_open(const char *name, int oflag, mode_t mode, struct pbap_session *pbap = context; const char *id; uint32_t handle; - int ret; + int ret = 0; void *request; DBG("name %s context %p valid %d", name, context, pbap->cache.valid); diff --git a/profiles/network/server.c b/profiles/network/server.c index a1c5646b..dfd63b23 100644 --- a/profiles/network/server.c +++ b/profiles/network/server.c @@ -344,7 +344,7 @@ static gboolean bnep_setup(GIOChannel *chan, GIOCondition cond, gpointer user_data) { struct network_adapter *na = user_data; - struct network_server *ns; + struct network_server *ns = NULL; struct network_session *session; uint8_t packet[BNEP_MTU]; struct bnep_setup_conn_req *req = (void *) packet; diff --git a/src/device.c b/src/device.c index a4b5e936..d55b9cda 100644 --- a/src/device.c +++ b/src/device.c @@ -274,7 +274,7 @@ static GSList *find_service_with_state(GSList *list, static void update_technologies(GKeyFile *file, struct btd_device *dev) { - const char *list[2]; + const char *list[2] = {NULL, NULL}; size_t len = 0; if (dev->bredr) diff --git a/tools/hciattach.c b/tools/hciattach.c index c213fe43..424748b5 100644 --- a/tools/hciattach.c +++ b/tools/hciattach.c @@ -1464,7 +1464,7 @@ int main(int argc, char *argv[]) dev[0] = 0; if (!strchr(opt, '/')) strcpy(dev, "/dev/"); - strcat(dev, opt); + strncat(dev, opt, PATH_MAX); break; case 1: diff --git a/tools/hcitool.c b/tools/hcitool.c index e1effc4b..59102f95 100644 --- a/tools/hcitool.c +++ b/tools/hcitool.c @@ -2385,7 +2385,8 @@ failed: static int print_advertising_devices(int dd, uint8_t filter_type) { - unsigned char buf[HCI_MAX_EVENT_SIZE], *ptr; + unsigned char buf[HCI_MAX_EVENT_SIZE] = {0}; + unsigned char *ptr; struct hci_filter nf, of; struct sigaction sa; socklen_t olen; |