[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r32826 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r32826 - gnunet/src/transport |
Date: |
Fri, 28 Mar 2014 22:41:12 +0100 |
Author: claudiu
Date: 2014-03-28 22:41:12 +0100 (Fri, 28 Mar 2014)
New Revision: 32826
Modified:
gnunet/src/transport/gnunet-helper-transport-bluetooth.c
Log:
Fixed the overflow problems reported in issue 3350
Modified: gnunet/src/transport/gnunet-helper-transport-bluetooth.c
===================================================================
--- gnunet/src/transport/gnunet-helper-transport-bluetooth.c 2014-03-28
16:41:42 UTC (rev 32825)
+++ gnunet/src/transport/gnunet-helper-transport-bluetooth.c 2014-03-28
21:41:12 UTC (rev 32826)
@@ -97,6 +97,11 @@
#endif
/**
+ * In bluez library, the maximum name length of a device is 8
+ */
+#define BLUEZ_DEVNAME_SIZE 8
+
+/**
* struct for storing the information of the hardware. There is only
* one of these.
*/
@@ -1156,7 +1161,7 @@
memset (&dev_info, 0, sizeof(struct hci_dev_info));
dev_info.dev_id = request.dev[i].dev_id;
- strncpy (dev_info.name, dev->iface, IFNAMSIZ);
+ strncpy (dev_info.name, dev->iface, BLUEZ_DEVNAME_SIZE);
if (ioctl (fd_hci, HCIGETDEVINFO, (void *) &dev_info))
{
@@ -1165,7 +1170,7 @@
return 1;
}
- if (strcmp (dev_info.name, dev->iface) == 0)
+ if (strncmp (dev_info.name, dev->iface, BLUEZ_DEVNAME_SIZE) == 0)
{
dev_id = dev_info.dev_id; //the device was found
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r32826 - gnunet/src/transport,
gnunet <=