diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2006-08-21 11:33:41 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2006-08-21 11:33:41 +0000 |
commit | c3e4d82dbd0dd64f2047a4c8f6e296b4f1485108 (patch) | |
tree | f39c9f75bdd9b1dcc422267b6e8d8c6e330ff2db /hcid | |
parent | 01416cc1b3b051c5b876f0ad8f9233a390ed7225 (diff) |
Initialize allocated memory to zero for a couple of ioctls
Diffstat (limited to 'hcid')
-rw-r--r-- | hcid/security.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hcid/security.c b/hcid/security.c index 08a5835d..98c00ca8 100644 --- a/hcid/security.c +++ b/hcid/security.c @@ -205,6 +205,8 @@ static inline int get_bdaddr(int dev, bdaddr_t *sba, uint16_t handle, bdaddr_t * if (!cl) return -ENOMEM; + memset(cl, 0, 10 * sizeof(*ci) + sizeof(*cl)); + ba2str(sba, addr); cl->dev_id = hci_devid(addr); cl->conn_num = 10; @@ -348,6 +350,8 @@ static void pin_code_request(int dev, bdaddr_t *sba, bdaddr_t *dba) if (!cr) return; + memset(cr, 0, sizeof(*cr) + sizeof(*ci)); + bacpy(&cr->bdaddr, dba); cr->type = ACL_LINK; if (ioctl(dev, HCIGETCONNINFO, (unsigned long) cr) < 0) { |