File ctapi-cyberjack-overflow.patch of Package pcsc-cyberjack
In function 'strncat',
inlined from 'ausb__get_dev_by_name' at ausb.c:328:
/usr/include/bits/string3.h:153: warning: call to __builtin___strncat_chk might overflow destination buffer
In function 'strncat',
inlined from 'ausb__get_dev_by_name' at ausb.c:360:
/usr/include/bits/string3.h:153: warning: call to __builtin___strncat_chk might overflow destination buffer
================================================================================
--- cjeca32/ausb/ausb.c
+++ cjeca32/ausb/ausb.c
@@ -325,7 +325,7 @@
libhal_ctx_set_dbus_connection(ctx, dbus_conn);
udi[0]=0;
- strncat(udi, devDir, sizeof(udi));
+ strncat(udi, devDir, sizeof(udi)-1);
for (;;) {
if (libhal_device_exists(ctx, udi, &dbus_error)) {
if (libhal_device_property_exists(ctx, udi, "usb.bus_number", NULL) &&
@@ -357,7 +357,7 @@
break;
}
udi[0]=0;
- strncat(udi, parent_udi, sizeof(udi));
+ strncat(udi, parent_udi, sizeof(udi)-1);
DEBUGP(NULL, "Looking at parent udi [%s]\n", udi);
}
else {