View Issue Details

IDProjectCategoryView StatusLast Update
0003350GNUnetBluetooth transportpublic2014-04-08 16:41
ReporterMatthias WachsAssigned Toclaudiu 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product VersionSVN HEAD 
Target Version0.10.1Fixed in Version0.10.1 
Summary0003350: Compile warning: overflow
DescriptionIn file included from /usr/include/string.h:638:0,
                 from /usr/include/bluetooth/bluetooth.h:35,
                 from gnunet-helper-transport-bluetooth.c:31:

In function ‘strncpy’,
    inlined from ‘open_device’ at gnunet-helper-transport-bluetooth.c:1159:15,
    inlined from ‘main’ at gnunet-helper-transport-bluetooth.c:1677:26:
/usr/include/x86_64-linux-gnu/bits/string3.h:120:3: warning: call to __builtin___strncpy_chk will always overflow destination buffer [enabled by default]
   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));


1159: strncpy (dev_info.name, dev->iface, IFNAMSIZ);

But:

IFNAMSIZ == 16
dev_info.name == char[8]

But there is a full strcmp:
1168: if (strcmp (dev_info.name, dev->iface) == 0)
TagsNo tags attached.

Activities

claudiu

2014-03-28 22:51

developer   ~0008163

Fixed in revision 32826.

Since the maximum name length of a device is 8 in bluez structures, I copied and compared only the first 8 bytes.

Issue History

Date Modified Username Field Change
2014-03-28 10:50 Matthias Wachs New Issue
2014-03-28 10:50 Matthias Wachs Status new => assigned
2014-03-28 10:50 Matthias Wachs Assigned To => claudiu
2014-03-28 22:51 claudiu Note Added: 0008163
2014-03-28 22:59 claudiu Status assigned => resolved
2014-03-28 22:59 claudiu Resolution open => fixed
2014-04-08 16:39 Christian Grothoff Product Version => SVN HEAD
2014-04-08 16:39 Christian Grothoff Fixed in Version => 0.10.1
2014-04-08 16:39 Christian Grothoff Target Version => 0.10.1
2014-04-08 16:41 Christian Grothoff Status resolved => closed