Task #84482 - avahi-0.8-6.20251126144056133750.pr3.337.g096c49f/scan-results.err
back to task #84482download
Error: SHELLCHECK_WARNING (CWE-477):
/etc/avahi/avahi-autoipd.action:38:17: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
# 36| METRIC=$((1000 + `cat "/sys/class/net/$2/ifindex" 2>/dev/null || echo 0`))
# 37|
# 38|-> if [ -x /bin/ip -o -x /sbin/ip ] ; then
# 39|
# 40| # We have the Linux ip tool from the iproute package
Error: SHELLCHECK_WARNING (CWE-477):
/etc/avahi/avahi-autoipd.action:60:25: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
# 58| esac
# 59|
# 60|-> elif [ -x /bin/ifconfig -o -x /sbin/ifconfig ] ; then
# 61|
# 62| # We have the old ifconfig tool
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-autoipd/iface-linux.c:108: style[constVariablePointer]: Variable 'ifi' can be declared as pointer to const
# 106| /* A link appeared or was removed */
# 107|
# 108|-> struct ifinfomsg *ifi;
# 109| ifi = NLMSG_DATA(n);
# 110|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-autoipd/iface-linux.c:189: style[constVariablePointer]: Variable 'ucred' can be declared as pointer to const
# 187| struct msghdr msghdr;
# 188| struct cmsghdr *cmsghdr;
# 189|-> struct ucred *ucred;
# 190| struct iovec iov;
# 191| struct nlmsghdr *p = (struct nlmsghdr *) replybuf;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-autoipd/iface-linux.c:234: style[constVariablePointer]: Variable 'e' can be declared as pointer to const
# 232|
# 233| if (p->nlmsg_type == NLMSG_ERROR) {
# 234|-> struct nlmsgerr *e = (struct nlmsgerr *) NLMSG_DATA (p);
# 235|
# 236| if (e->error) {
Error: COMPILER_WARNING (CWE-252):
avahi-0.8/avahi-autoipd/main.c: scope_hint: In function ‘init_rand_seed’
avahi-0.8/avahi-autoipd/main.c:189:9: warning[-Wunused-result]: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’
# 189 | read(fd, &seed, sizeof(seed));
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 187| * booted at the same time choose different random seeds. */
# 188| if ((fd = open(RANDOM_DEVICE, O_RDONLY)) >= 0) {
# 189|-> read(fd, &seed, sizeof(seed));
# 190| close(fd);
# 191| }
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-autoipd/main.c:583: style[constVariablePointer]: Variable 'lim' can be declared as pointer to const
# 581| char *buf;
# 582| struct if_msghdr *ifm;
# 583|-> char *lim;
# 584| char *next;
# 585| struct sockaddr_dl *sdl;
Error: GCC_ANALYZER_WARNING (CWE-617):
avahi-0.8/avahi-autoipd/main.c: scope_hint: In function ‘fork_dispatcher’
avahi-0.8/avahi-autoipd/main.c:843:13: warning[-Wanalyzer-tainted-assertion]: use of attacked-controlled value in condition for assertion
avahi-0.8/avahi-common/malloc.h:28: included_from: Included from here.
avahi-0.8/avahi-autoipd/main.c:68: included_from: Included from here.
# 841| }
# 842|
# 843|-> assert(info.event <= CALLOUT_MAX);
# 844|
# 845| if (!if_indextoname(info.ifindex, name)) {
Error: GCC_ANALYZER_WARNING (CWE-775):
avahi-0.8/avahi-autoipd/main.c:892:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
# 890| }
# 891|
# 892|-> return ret;
# 893|
# 894| fail:
Error: GCC_ANALYZER_WARNING (CWE-775):
avahi-0.8/avahi-autoipd/main.c:892:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
# 890| }
# 891|
# 892|-> return ret;
# 893|
# 894| fail:
Error: COMPILER_WARNING (CWE-252):
avahi-0.8/avahi-autoipd/main.c: scope_hint: In function ‘drop_privs’
avahi-0.8/avahi-autoipd/main.c:967:9: warning[-Wunused-result]: ignoring return value of ‘chown’ declared with attribute ‘warn_unused_result’
# 967 | chown(AVAHI_IPDATA_DIR, pw->pw_uid, gr->gr_gid);
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 965| struct stat st;
# 966|
# 967|-> chown(AVAHI_IPDATA_DIR, pw->pw_uid, gr->gr_gid);
# 968|
# 969| if (stat(AVAHI_IPDATA_DIR, &st) < 0) {
Error: COMPILER_WARNING (CWE-252):
avahi-0.8/avahi-autoipd/main.c:989:9: warning[-Wunused-result]: ignoring return value of ‘chdir’ declared with attribute ‘warn_unused_result’
# 989 | chdir("/");
# | ^~~~~~~~~~
# 987|
# 988| daemon_log(LOG_INFO, "Successfully called chroot().");
# 989|-> chdir("/");
# 990|
# 991| /* Since we are now trapped inside a chroot we cannot remove
Error: COMPILER_WARNING (CWE-252):
avahi-0.8/avahi-autoipd/main.c: scope_hint: In function ‘main’
avahi-0.8/avahi-autoipd/main.c:1658:9: warning[-Wunused-result]: ignoring return value of ‘chdir’ declared with attribute ‘warn_unused_result’
# 1658 | chdir("/");
# | ^~~~~~~~~~
# 1656| daemon_log_use = DAEMON_LOG_SYSLOG;
# 1657|
# 1658|-> chdir("/");
# 1659|
# 1660| if (daemon_pid_file_create() < 0) {
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/browser.c:42: style[constVariablePointer]: Variable 'e' can be declared as pointer to const
# 40|
# 41| static void parse_environment(AvahiDomainBrowser *b) {
# 42|-> char buf[AVAHI_DOMAIN_NAME_MAX*3], *e, *t, *p;
# 43|
# 44| assert(b);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/check-nss-test.c:28: style[constParameter]: Parameter 'argv' can be declared as const array
# 26| #include <avahi-client/client.h>
# 27|
# 28|-> int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
# 29| printf("NSS Support available: %s\n", avahi_nss_support() ? "yes" : "no");
# 30| return 0;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:42: style[constParameterCallback]: Parameter 'c' can be declared as pointer to const. However it seems that 'avahi_client_callback' is a callback function, if 'c' is declared with const you might also need to cast function pointer(s).
# 40| static AvahiSimplePoll *simple_poll = NULL;
# 41|
# 42|-> static void avahi_client_callback (AvahiClient *c, AvahiClientState state, void *userdata) {
# 43| printf ("CLIENT: Callback on %p, state -> %d, data -> %s\n", (void*) c, state, (char*)userdata);
# 44| }
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:42: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'avahi_client_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
# 40| static AvahiSimplePoll *simple_poll = NULL;
# 41|
# 42|-> static void avahi_client_callback (AvahiClient *c, AvahiClientState state, void *userdata) {
# 43| printf ("CLIENT: Callback on %p, state -> %d, data -> %s\n", (void*) c, state, (char*)userdata);
# 44| }
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:46: style[constParameterCallback]: Parameter 'g' can be declared as pointer to const. However it seems that 'avahi_entry_group_callback' is a callback function, if 'g' is declared with const you might also need to cast function pointer(s).
# 44| }
# 45|
# 46|-> static void avahi_entry_group_callback (AvahiEntryGroup *g, AvahiEntryGroupState state, void *userdata) {
# 47| printf ("ENTRY-GROUP: Callback on %p, state -> %d, data -> %s\n", (void*) g, state, (char*)userdata);
# 48| }
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:46: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'avahi_entry_group_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
# 44| }
# 45|
# 46|-> static void avahi_entry_group_callback (AvahiEntryGroup *g, AvahiEntryGroupState state, void *userdata) {
# 47| printf ("ENTRY-GROUP: Callback on %p, state -> %d, data -> %s\n", (void*) g, state, (char*)userdata);
# 48| }
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:50: style[constParameterCallback]: Parameter 'g' can be declared as pointer to const. However it seems that 'avahi_entry_group2_callback' is a callback function, if 'g' is declared with const you might also need to cast function pointer(s).
# 48| }
# 49|
# 50|-> static void avahi_entry_group2_callback (AvahiEntryGroup *g, AvahiEntryGroupState state, void *userdata) {
# 51| printf ("ENTRY-GROUP2: Callback on %p, state -> %d, data -> %s\n", (void*) g, state, (char*)userdata);
# 52| }
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:50: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'avahi_entry_group2_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
# 48| }
# 49|
# 50|-> static void avahi_entry_group2_callback (AvahiEntryGroup *g, AvahiEntryGroupState state, void *userdata) {
# 51| printf ("ENTRY-GROUP2: Callback on %p, state -> %d, data -> %s\n", (void*) g, state, (char*)userdata);
# 52| }
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:55: style[constParameterCallback]: Parameter 'b' can be declared as pointer to const. However it seems that 'avahi_domain_browser_callback' is a callback function, if 'b' is declared with const you might also need to cast function pointer(s).
# 53|
# 54| static void avahi_domain_browser_callback(
# 55|-> AvahiDomainBrowser *b,
# 56| AvahiIfIndex interface,
# 57| AvahiProtocol protocol,
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:61: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'avahi_domain_browser_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
# 59| const char *domain,
# 60| AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
# 61|-> void *userdata) {
# 62|
# 63| printf ("DOMAIN-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), domain (%s), data (%s)\n", (void*) b, interface, protocol, event, domain ? domain : "NULL", (char*)userdata);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:67: style[constParameterCallback]: Parameter 'r' can be declared as pointer to const. However it seems that 'avahi_service_resolver_callback' is a callback function, if 'r' is declared with const you might also need to cast function pointer(s).
# 65|
# 66| static void avahi_service_resolver_callback(
# 67|-> AvahiServiceResolver *r,
# 68| AvahiIfIndex interface,
# 69| AvahiProtocol protocol,
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:79: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'avahi_service_resolver_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
# 77| AvahiStringList *txt,
# 78| AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
# 79|-> void *userdata) {
# 80|
# 81| char addr[64];
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:102: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'avahi_service_browser_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
# 100| const char *domain,
# 101| AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
# 102|-> void *userdata) {
# 103|
# 104| AvahiServiceResolver *sr;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:104: style[constVariablePointer]: Variable 'sr' can be declared as pointer to const
# 102| void *userdata) {
# 103|
# 104|-> AvahiServiceResolver *sr;
# 105|
# 106| printf ("SERVICE-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), name (%s), type (%s), domain (%s), data (%s)\n", (void*) b, interface, protocol, event, name ? name : "NULL", type, domain ? domain : "NULL", (char*)userdata);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:104: style[variableScope]: The scope of the variable 'sr' can be reduced.
# 102| void *userdata) {
# 103|
# 104|-> AvahiServiceResolver *sr;
# 105|
# 106| printf ("SERVICE-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), name (%s), type (%s), domain (%s), data (%s)\n", (void*) b, interface, protocol, event, name ? name : "NULL", type, domain ? domain : "NULL", (char*)userdata);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:116: style[constParameterCallback]: Parameter 'b' can be declared as pointer to const. However it seems that 'avahi_service_type_browser_callback' is a callback function, if 'b' is declared with const you might also need to cast function pointer(s).
# 114|
# 115| static void avahi_service_type_browser_callback (
# 116|-> AvahiServiceTypeBrowser *b,
# 117| AvahiIfIndex interface,
# 118| AvahiProtocol protocol,
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:123: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'avahi_service_type_browser_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
# 121| const char *domain,
# 122| AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
# 123|-> void *userdata) {
# 124|
# 125| printf ("SERVICE-TYPE-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), type (%s), domain (%s), data (%s)\n", (void*) b, interface, protocol, event, type ? type : "NULL", domain ? domain : "NULL", (char*)userdata);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:136: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'avahi_address_resolver_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
# 134| const char *name,
# 135| AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
# 136|-> void *userdata) {
# 137|
# 138| char addr[64];
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:155: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'avahi_host_name_resolver_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
# 153| const AvahiAddress *a,
# 154| AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
# 155|-> void *userdata) {
# 156|
# 157| AvahiClient *client;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:158: style[constVariablePointer]: Variable 'ar' can be declared as pointer to const
# 156|
# 157| AvahiClient *client;
# 158|-> AvahiAddressResolver *ar;
# 159| char addr[64];
# 160|
Error: CPPCHECK_WARNING (CWE-475):
avahi-0.8/avahi-client/client-test.c:197: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
# 195| avahi_entry_group_reset (g);
# 196|
# 197|-> avahi_entry_group_add_service (g, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "Lathiat's Site", "_http._tcp", NULL, NULL, 80, "foo=bar2", NULL);
# 198|
# 199| avahi_entry_group_commit (g);
Error: CPPCHECK_WARNING (CWE-475):
avahi-0.8/avahi-client/client-test.c:207: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
# 205| printf ("Updating entry group\n");
# 206|
# 207|-> avahi_entry_group_update_service_txt(g, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "Lathiat's Site", "_http._tcp", NULL, "foo=bar3", NULL);
# 208| }
# 209|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:218: style[constVariablePointer]: Variable 'domain' can be declared as pointer to const
# 216| AvahiClient *avahi;
# 217| AvahiEntryGroup *group, *group2;
# 218|-> AvahiDomainBrowser *domain;
# 219| AvahiServiceBrowser *sb;
# 220| AvahiServiceTypeBrowser *st;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:220: style[constVariablePointer]: Variable 'st' can be declared as pointer to const
# 218| AvahiDomainBrowser *domain;
# 219| AvahiServiceBrowser *sb;
# 220|-> AvahiServiceTypeBrowser *st;
# 221| AvahiHostNameResolver *hnr;
# 222| AvahiAddress *aar;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:221: style[constVariablePointer]: Variable 'hnr' can be declared as pointer to const
# 219| AvahiServiceBrowser *sb;
# 220| AvahiServiceTypeBrowser *st;
# 221|-> AvahiHostNameResolver *hnr;
# 222| AvahiAddress *aar;
# 223| const char *ret;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/client-test.c:222: style[constVariablePointer]: Variable 'aar' can be declared as pointer to const
# 220| AvahiServiceTypeBrowser *st;
# 221| AvahiHostNameResolver *hnr;
# 222|-> AvahiAddress *aar;
# 223| const char *ret;
# 224| int error;
Error: CPPCHECK_WARNING (CWE-476):
avahi-0.8/avahi-client/client-test.c:243: warning[nullPointerRedundantCheck]: Either the condition 'ret' is redundant or there is possible null pointer dereference: ret.
# 241|
# 242| ret = avahi_client_get_version_string (avahi);
# 243|-> printf("Avahi Server Version: %s (Error Return: %s)\n", ret, ret ? "OK" : avahi_strerror(avahi_client_errno(avahi)));
# 244|
# 245| ret = avahi_client_get_host_name (avahi);
Error: CPPCHECK_WARNING (CWE-476):
avahi-0.8/avahi-client/client-test.c:246: warning[nullPointerRedundantCheck]: Either the condition 'ret' is redundant or there is possible null pointer dereference: ret.
# 244|
# 245| ret = avahi_client_get_host_name (avahi);
# 246|-> printf("Host Name: %s (Error Return: %s)\n", ret, ret ? "OK" : avahi_strerror(avahi_client_errno(avahi)));
# 247|
# 248| ret = avahi_client_get_domain_name (avahi);
Error: CPPCHECK_WARNING (CWE-476):
avahi-0.8/avahi-client/client-test.c:249: warning[nullPointerRedundantCheck]: Either the condition 'ret' is redundant or there is possible null pointer dereference: ret.
# 247|
# 248| ret = avahi_client_get_domain_name (avahi);
# 249|-> printf("Domain Name: %s (Error Return: %s)\n", ret, ret ? "OK" : avahi_strerror(avahi_client_errno(avahi)));
# 250|
# 251| ret = avahi_client_get_host_name_fqdn (avahi);
Error: CPPCHECK_WARNING (CWE-476):
avahi-0.8/avahi-client/client-test.c:252: warning[nullPointerRedundantCheck]: Either the condition 'ret' is redundant or there is possible null pointer dereference: ret.
# 250|
# 251| ret = avahi_client_get_host_name_fqdn (avahi);
# 252|-> printf("FQDN: %s (Error Return: %s)\n", ret, ret ? "OK" : avahi_strerror(avahi_client_errno(avahi)));
# 253|
# 254| cookie = avahi_client_get_local_service_cookie(avahi);
Error: CPPCHECK_WARNING (CWE-475):
avahi-0.8/avahi-client/client-test.c:264: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
# 262| printf("Successfully created entry group %p\n", (void*) group);
# 263|
# 264|-> printf("%s\n", avahi_strerror(avahi_entry_group_add_service (group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "Lathiat's Site", "_http._tcp", NULL, NULL, 80, "foo=bar", NULL)));
# 265| printf("add_record: %d\n", avahi_entry_group_add_record (group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "TestX", 0x01, 0x10, 120, "\5booya", 6));
# 266|
Error: CPPCHECK_WARNING (CWE-476):
avahi-0.8/avahi-client/client.c:144: warning[nullPointerRedundantCheck]: Either the condition '!old' is redundant or there is possible null pointer dereference: old.
# 142| if (strcmp(name, AVAHI_DBUS_NAME) == 0) {
# 143|
# 144|-> if (old[0] &&
# 145| avahi_client_is_connected(client)) {
# 146|
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-client/client.c:800: style[unreadVariable]: Variable 'r' is assigned a value that is never used.
# 798| DBusMessage *message = NULL, *reply = NULL;
# 799| DBusError error;
# 800|-> int r = AVAHI_OK;
# 801|
# 802| dbus_error_init(&error);
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-client/entrygroup.c:55: style[unreadVariable]: Variable 'r' is assigned a value that is never used.
# 53| DBusMessage *message = NULL, *reply = NULL;
# 54| DBusError error;
# 55|-> int r = AVAHI_OK;
# 56| int32_t state;
# 57| AvahiClient *client;
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-client/entrygroup.c:191: style[unreadVariable]: Variable 'r' is assigned a value that is never used.
# 189| DBusMessage *message = NULL, *reply = NULL;
# 190| DBusError error;
# 191|-> int r = AVAHI_OK;
# 192| AvahiClient *client;
# 193|
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-client/entrygroup.c:299: style[unreadVariable]: Variable 'r' is assigned a value that is never used.
# 297| DBusMessage *message = NULL, *reply = NULL;
# 298| DBusError error;
# 299|-> int r = AVAHI_OK;
# 300| int b;
# 301| AvahiClient *client;
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-client/entrygroup.c:397: style[unreadVariable]: Variable 'txt' is assigned a value that is never used.
# 395|
# 396| /* Reverse the string list to the original state */
# 397|-> txt = avahi_string_list_reverse(txt);
# 398|
# 399| return r;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/entrygroup.c:397: warning[uselessAssignmentPtrArg]: Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
# 395|
# 396| /* Reverse the string list to the original state */
# 397|-> txt = avahi_string_list_reverse(txt);
# 398|
# 399| return r;
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-client/entrygroup.c:415: style[unreadVariable]: Variable 'r' is assigned a value that is never used.
# 413|
# 414| DBusMessage *message = NULL, *reply = NULL;
# 415|-> int r = AVAHI_OK;
# 416| DBusError error;
# 417| AvahiClient *client;
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-client/entrygroup.c:533: style[unreadVariable]: Variable 'r' is assigned a value that is never used.
# 531|
# 532| DBusMessage *message = NULL, *reply = NULL;
# 533|-> int r = AVAHI_OK;
# 534| DBusError error;
# 535| AvahiClient *client;
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-client/entrygroup.c:644: style[unreadVariable]: Variable 'r' is assigned a value that is never used.
# 642|
# 643| DBusMessage *message = NULL, *reply = NULL;
# 644|-> int r = AVAHI_OK;
# 645| DBusError error;
# 646| AvahiClient *client;
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-client/entrygroup.c:730: style[unreadVariable]: Variable 'r' is assigned a value that is never used.
# 728|
# 729| DBusMessage *message = NULL, *reply = NULL;
# 730|-> int r = AVAHI_OK;
# 731| DBusError error;
# 732| AvahiClient *client;
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-client/entrygroup.c:821: style[unreadVariable]: Variable 'r' is assigned a value that is never used.
# 819|
# 820| DBusMessage *message = NULL, *reply = NULL;
# 821|-> int r = AVAHI_OK;
# 822| DBusError error;
# 823| AvahiClient *client;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-client/xdg-config.c:39: style[constVariablePointer]: Variable 'p' can be declared as pointer to const
# 37| FILE *f;
# 38| const char *e, *d;
# 39|-> char fn[PATH_MAX], *p = NULL, buf[2048], *s = NULL;
# 40|
# 41| assert(filename);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-common/alternative.c:35: style[constParameterPointer]: Parameter 'c' can be declared as pointer to const
# 33| #include "utf8.h"
# 34|
# 35|-> static void drop_incomplete_utf8(char *c) {
# 36| char *e;
# 37|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-common/alternative.c:54: style[constVariablePointer]: Variable 'ret' can be declared as pointer to const
# 52| char *avahi_alternative_host_name(const char *s) {
# 53| char label[AVAHI_LABEL_MAX], alternative[AVAHI_LABEL_MAX*4+1];
# 54|-> char *alt, *r, *ret;
# 55| const char *e;
# 56| size_t len;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-common/dbus-watch-glue.c:311: style[variableScope]: The scope of the variable 'd' can be reduced.
# 309|
# 310| static void dispatch_status(AVAHI_GCC_UNUSED DBusConnection *connection, DBusDispatchStatus new_status, void *userdata) {
# 311|-> ConnectionData *d = userdata;
# 312|
# 313| if (new_status == DBUS_DISPATCH_DATA_REMAINS)
Error: CPPCHECK_WARNING (CWE-570):
avahi-0.8/avahi-common/malloc.c:103: style[unsignedLessThanZero]: Checking if unsigned expression 'size' is less than zero.
# 101| void *avahi_malloc(size_t size) {
# 102|
# 103|-> if (size <= 0)
# 104| return NULL;
# 105|
Error: CPPCHECK_WARNING (CWE-570):
avahi-0.8/avahi-common/malloc.c:116: style[unsignedLessThanZero]: Checking if unsigned expression 'size' is less than zero.
# 114| void *p;
# 115|
# 116|-> if (size <= 0)
# 117| return NULL;
# 118|
Error: CPPCHECK_WARNING (CWE-664):
avahi-0.8/avahi-common/malloc.c:214: error[va_list_usedBeforeStarted]: va_list 'ap2' used before va_start() was called.
# 212| va_list ap2;
# 213|
# 214|-> va_copy (ap2, ap);
# 215| n = vsnprintf(buf, len, fmt, ap2);
# 216| va_end (ap2);
Error: CPPCHECK_WARNING (CWE-664):
avahi-0.8/avahi-common/malloc.c:215: error[va_list_usedBeforeStarted]: va_list 'ap2' used before va_start() was called.
# 213|
# 214| va_copy (ap2, ap);
# 215|-> n = vsnprintf(buf, len, fmt, ap2);
# 216| va_end (ap2);
# 217|
Error: CPPCHECK_WARNING (CWE-664):
avahi-0.8/avahi-common/malloc.c:216: error[va_list_usedBeforeStarted]: va_list 'ap2' used before va_start() was called.
# 214| va_copy (ap2, ap);
# 215| n = vsnprintf(buf, len, fmt, ap2);
# 216|-> va_end (ap2);
# 217|
# 218| if (n >= 0 && n < (int) len)
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-common/rlist.c:41: style[constParameterPointer]: Parameter 'data' can be declared as pointer to const
# 39| }
# 40|
# 41|-> AvahiRList* avahi_rlist_remove(AvahiRList *r, void *data) {
# 42| AvahiRList *n;
# 43|
Error: COMPILER_WARNING (CWE-252):
avahi-0.8/avahi-common/simple-watch.c: scope_hint: In function 'avahi_simple_poll_wakeup'
avahi-0.8/avahi-common/simple-watch.c:101:5: warning[-Wunused-result]: ignoring return value of 'write' declared with attribute 'warn_unused_result'
# 101 | write(s->wakeup_pipe[1], &c, sizeof(c));
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 99| assert(s);
# 100|
# 101|-> write(s->wakeup_pipe[1], &c, sizeof(c));
# 102| s->wakeup_issued = 1;
# 103| }
Error: COMPILER_WARNING (CWE-252):
avahi-0.8/avahi-common/simple-watch.c: scope_hint: In function ‘avahi_simple_poll_wakeup’
avahi-0.8/avahi-common/simple-watch.c:101:5: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
# 101 | write(s->wakeup_pipe[1], &c, sizeof(c));
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 99| assert(s);
# 100|
# 101|-> write(s->wakeup_pipe[1], &c, sizeof(c));
# 102| s->wakeup_issued = 1;
# 103| }
Error: CPPCHECK_WARNING (CWE-570):
avahi-0.8/avahi-common/simple-watch.c:605: style[knownConditionTrueFalse]: Condition '(r=avahi_simple_poll_dispatch(s))!=0' is always false
# 603| return r;
# 604|
# 605|-> if ((r = avahi_simple_poll_dispatch(s)) != 0)
# 606| return r;
# 607|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-common/simple-watch.c:641: style[variableScope]: The scope of the variable 'r' can be reduced.
# 639|
# 640| int avahi_simple_poll_loop(AvahiSimplePoll *s) {
# 641|-> int r;
# 642|
# 643| assert(s);
Error: CPPCHECK_WARNING (CWE-475):
avahi-0.8/avahi-common/strlst-test.c:39: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
# 37| int r;
# 38|
# 39|-> a = avahi_string_list_new("prefix", "a", "b", NULL);
# 40|
# 41| a = avahi_string_list_add(a, "start");
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-common/strlst.c:222: style[unreadVariable]: Variable 'l' is assigned a value that is never used.
# 220| }
# 221|
# 222|-> l = avahi_string_list_reverse(l);
# 223|
# 224| *e = 0;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-common/strlst.c:222: warning[uselessAssignmentPtrArg]: Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
# 220| }
# 221|
# 222|-> l = avahi_string_list_reverse(l);
# 223|
# 224| *e = 0;
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-common/strlst.c:262: style[unreadVariable]: Variable 'l' is assigned a value that is never used.
# 260| }
# 261|
# 262|-> l = avahi_string_list_reverse(l);
# 263|
# 264| if (used == 0 && size > 0) {
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-common/strlst.c:336: style[variableScope]: The scope of the variable 'va' can be reduced.
# 334|
# 335| AvahiStringList *avahi_string_list_new(const char *txt, ...) {
# 336|-> va_list va;
# 337| AvahiStringList *r = NULL;
# 338|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-common/strlst.c:485: style[constVariablePointer]: Variable 'e' can be declared as pointer to const
# 483|
# 484| int avahi_string_list_get_pair(AvahiStringList *l, char **key, char **value, size_t *size) {
# 485|-> char *e;
# 486|
# 487| assert(l);
Error: COMPILER_WARNING (CWE-843):
avahi-0.8/avahi-compat-howl/compat.c: scope_hint: In function 'client_callback'
avahi-0.8/avahi-compat-howl/compat.c:325:18: warning[-Wcast-function-type]: cast between incompatible function types from 'sw_result (*)(void)' {aka 'int (*)(void)'} to 'sw_result (*)(struct _sw_discovery *, sw_discovery_oid, sw_discovery_browse_status, sw_uint32, const char *, const char *, const char *, void *)' {aka 'int (*)(struct _sw_discovery *, unsigned int, enum _sw_discovery_browse_status, unsigned int, const char *, const char *, const char *, void *)'}
# 325 | ((sw_discovery_browse_reply) self->oid_table[oid].reply)(self, oid, SW_DISCOVERY_BROWSE_INVALID, 0, NULL, NULL, NULL, self->oid_table[oid].extra);
# | ^
# 323| case OID_DOMAIN_BROWSER:
# 324| case OID_SERVICE_BROWSER:
# 325|-> ((sw_discovery_browse_reply) self->oid_table[oid].reply)(self, oid, SW_DISCOVERY_BROWSE_INVALID, 0, NULL, NULL, NULL, self->oid_table[oid].extra);
# 326| break;
# 327|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-compat-howl/compat.c:590: style[variableScope]: The scope of the variable 'ret' can be reduced.
# 588|
# 589| sw_result sw_salt_run(sw_salt self) {
# 590|-> sw_result ret;
# 591|
# 592| AVAHI_WARN_LINKAGE;
Error: COMPILER_WARNING (CWE-843):
avahi-0.8/avahi-compat-howl/compat.c: scope_hint: In function 'reg_report_status'
avahi-0.8/avahi-compat-howl/compat.c:636:13: warning[-Wcast-function-type]: cast between incompatible function types from 'sw_result (*)(void)' {aka 'int (*)(void)'} to 'sw_result (*)(struct _sw_discovery *, sw_discovery_oid, sw_discovery_publish_status, void *)' {aka 'int (*)(struct _sw_discovery *, unsigned int, enum _sw_discovery_publish_status, void *)'}
# 636 | reply = (sw_discovery_publish_reply) data->reply;
# | ^
# 634| assert(data);
# 635|
# 636|-> reply = (sw_discovery_publish_reply) data->reply;
# 637|
# 638| reply(data->discovery,
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/compat.c:703: style[unreadVariable]: Variable 'ret' is assigned a value that is never used.
# 701|
# 702| /* Register the service */
# 703|-> if ((ret = reg_create_service(data)) < 0) {
# 704| reg_report_status(data, SW_DISCOVERY_PUBLISH_INVALID);
# 705| return;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-compat-howl/compat.c:762: style[constParameterPointer]: Parameter 'text_record' can be declared as pointer to const
# 760| sw_const_string host,
# 761| sw_port port,
# 762|-> sw_octets text_record,
# 763| sw_uint32 text_record_len,
# 764| sw_discovery_publish_reply reply,
Error: COMPILER_WARNING (CWE-843):
avahi-0.8/avahi-compat-howl/compat.c: scope_hint: In function 'sw_discovery_publish'
avahi-0.8/avahi-compat-howl/compat.c:798:19: warning[-Wcast-function-type]: cast between incompatible function types from 'sw_discovery_publish_reply' {aka 'int (*)(struct _sw_discovery *, unsigned int, enum _sw_discovery_publish_status, void *)'} to 'sw_result (*)(void)' {aka 'int (*)(void)'}
# 798 | data->reply = (sw_result (*)(void)) reply;
# | ^
# 796| data = oid_get(self, *oid);
# 797| assert(data);
# 798|-> data->reply = (sw_result (*)(void)) reply;
# 799| data->extra = extra;
# 800| data->service_data = sdata;
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/compat.c:828: style[redundantInitialization]: Redundant initialization for 'result'. The initialized value is overwritten before it is read.
# 826| }
# 827|
# 828|-> result = SW_OKAY;
# 829|
# 830| finish:
Error: COMPILER_WARNING (CWE-843):
avahi-0.8/avahi-compat-howl/compat.c: scope_hint: In function 'domain_browser_callback'
avahi-0.8/avahi-compat-howl/compat.c:857:13: warning[-Wcast-function-type]: cast between incompatible function types from 'sw_result (*)(void)' {aka 'int (*)(void)'} to 'sw_result (*)(struct _sw_discovery *, sw_discovery_oid, sw_discovery_browse_status, sw_uint32, const char *, const char *, const char *, void *)' {aka 'int (*)(struct _sw_discovery *, unsigned int, enum _sw_discovery_browse_status, unsigned int, const char *, const char *, const char *, void *)'}
# 857 | reply = (sw_discovery_browse_reply) data->reply;
# | ^
# 855| assert(data);
# 856|
# 857|-> reply = (sw_discovery_browse_reply) data->reply;
# 858|
# 859| domain = add_trailing_dot(domain, domain_fixed, sizeof(domain_fixed));
Error: COMPILER_WARNING (CWE-843):
avahi-0.8/avahi-compat-howl/compat.c: scope_hint: In function 'sw_discovery_browse_domains'
avahi-0.8/avahi-compat-howl/compat.c:902:19: warning[-Wcast-function-type]: cast between incompatible function types from 'sw_discovery_browse_reply' {aka 'int (*)(struct _sw_discovery *, unsigned int, enum _sw_discovery_browse_status, unsigned int, const char *, const char *, const char *, void *)'} to 'sw_result (*)(void)' {aka 'int (*)(void)'}
# 902 | data->reply = (sw_result (*)(void)) reply;
# | ^
# 900| data = oid_get(self, *oid);
# 901| assert(data);
# 902|-> data->reply = (sw_result (*)(void)) reply;
# 903| data->extra = extra;
# 904|
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/compat.c:914: style[redundantInitialization]: Redundant initialization for 'result'. The initialized value is overwritten before it is read.
# 912| }
# 913|
# 914|-> result = SW_OKAY;
# 915|
# 916| finish:
Error: COMPILER_WARNING (CWE-843):
avahi-0.8/avahi-compat-howl/compat.c: scope_hint: In function 'service_resolver_callback'
avahi-0.8/avahi-compat-howl/compat.c:948:13: warning[-Wcast-function-type]: cast between incompatible function types from 'sw_result (*)(void)' {aka 'int (*)(void)'} to 'sw_result (*)(struct _sw_discovery *, sw_discovery_oid, sw_uint32, const char *, const char *, const char *, sw_ipv4_address, sw_port, sw_uint8 *, sw_uint32, void *)' {aka 'int (*)(struct _sw_discovery *, unsigned int, unsigned int, const char *, const char *, const char *, struct _sw_ipv4_address, short unsigned int, unsigned char *, unsigned int, void *)'}
# 948 | reply = (sw_discovery_resolve_reply) data->reply;
# | ^
# 946| assert(data);
# 947|
# 948|-> reply = (sw_discovery_resolve_reply) data->reply;
# 949|
# 950| switch (event) {
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/compat.c:960: style[unreadVariable]: Variable 'host_name' is assigned a value that is never used.
# 958| sw_ipv4_address_init_from_saddr(&addr, a->data.ipv4.address);
# 959|
# 960|-> host_name = add_trailing_dot(host_name, host_name_fixed, sizeof(host_name_fixed));
# 961|
# 962| if ((p = avahi_new0(uint8_t, (l = avahi_string_list_serialize(txt, NULL, 0))+1)))
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-compat-howl/compat.c:960: warning[uselessAssignmentPtrArg]: Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
# 958| sw_ipv4_address_init_from_saddr(&addr, a->data.ipv4.address);
# 959|
# 960|-> host_name = add_trailing_dot(host_name, host_name_fixed, sizeof(host_name_fixed));
# 961|
# 962| if ((p = avahi_new0(uint8_t, (l = avahi_string_list_serialize(txt, NULL, 0))+1)))
Error: COMPILER_WARNING (CWE-843):
avahi-0.8/avahi-compat-howl/compat.c: scope_hint: In function 'sw_discovery_resolve'
avahi-0.8/avahi-compat-howl/compat.c:1011:19: warning[-Wcast-function-type]: cast between incompatible function types from 'sw_discovery_resolve_reply' {aka 'int (*)(struct _sw_discovery *, unsigned int, unsigned int, const char *, const char *, const char *, struct _sw_ipv4_address, short unsigned int, unsigned char *, unsigned int, void *)'} to 'sw_result (*)(void)' {aka 'int (*)(void)'}
# 1011 | data->reply = (sw_result (*)(void)) reply;
# | ^
# 1009| data = oid_get(self, *oid);
# 1010| assert(data);
# 1011|-> data->reply = (sw_result (*)(void)) reply;
# 1012| data->extra = extra;
# 1013|
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/compat.c:1023: style[redundantInitialization]: Redundant initialization for 'result'. The initialized value is overwritten before it is read.
# 1021| }
# 1022|
# 1023|-> result = SW_OKAY;
# 1024|
# 1025| finish:
Error: COMPILER_WARNING (CWE-843):
avahi-0.8/avahi-compat-howl/compat.c: scope_hint: In function 'service_browser_callback'
avahi-0.8/avahi-compat-howl/compat.c:1054:13: warning[-Wcast-function-type]: cast between incompatible function types from 'sw_result (*)(void)' {aka 'int (*)(void)'} to 'sw_result (*)(struct _sw_discovery *, sw_discovery_oid, sw_discovery_browse_status, sw_uint32, const char *, const char *, const char *, void *)' {aka 'int (*)(struct _sw_discovery *, unsigned int, enum _sw_discovery_browse_status, unsigned int, const char *, const char *, const char *, void *)'}
# 1054 | reply = (sw_discovery_browse_reply) data->reply;
# | ^
# 1052| assert(data);
# 1053|
# 1054|-> reply = (sw_discovery_browse_reply) data->reply;
# 1055|
# 1056| type = add_trailing_dot(type, type_fixed, sizeof(type_fixed));
Error: COMPILER_WARNING (CWE-843):
avahi-0.8/avahi-compat-howl/compat.c: scope_hint: In function 'sw_discovery_browse'
avahi-0.8/avahi-compat-howl/compat.c:1103:19: warning[-Wcast-function-type]: cast between incompatible function types from 'sw_discovery_browse_reply' {aka 'int (*)(struct _sw_discovery *, unsigned int, enum _sw_discovery_browse_status, unsigned int, const char *, const char *, const char *, void *)'} to 'sw_result (*)(void)' {aka 'int (*)(void)'}
# 1103 | data->reply = (sw_result (*)(void)) reply;
# | ^
# 1101| data = oid_get(self, *oid);
# 1102| assert(data);
# 1103|-> data->reply = (sw_result (*)(void)) reply;
# 1104| data->extra = extra;
# 1105|
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/compat.c:1115: style[redundantInitialization]: Redundant initialization for 'result'. The initialized value is overwritten before it is read.
# 1113| }
# 1114|
# 1115|-> result = SW_OKAY;
# 1116|
# 1117| finish:
Error: COMPILER_WARNING:
avahi-0.8/avahi-compat-howl/include/salt/salt.h:32: included_from: Included from here.
avahi-0.8/avahi-compat-howl/include/howl.h:32: included_from: Included from here.
avahi-0.8/avahi-compat-howl/unsupported.c:26: included_from: Included from here.
avahi-0.8/avahi-compat-howl/include/salt/platform.h:411:1: warning[-Wstrict-prototypes]: function declaration isn't a prototype
# 411 | sw_strerror();
# | ^~~~~~~~~~~
# 409|
# 410| sw_const_string
# 411|-> sw_strerror();
# 412|
# 413|
Error: COMPILER_WARNING:
avahi-0.8/avahi-compat-howl/include/salt/salt.h:32: included_from: Included from here.
avahi-0.8/avahi-compat-howl/include/howl.h:32: included_from: Included from here.
avahi-0.8/avahi-compat-howl/address.c:34: included_from: Included from here.
avahi-0.8/avahi-compat-howl/include/salt/platform.h:411:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
# 411 | sw_strerror();
# | ^~~~~~~~~~~
# 409|
# 410| sw_const_string
# 411|-> sw_strerror();
# 412|
# 413|
Error: COMPILER_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/browse.c:46:73: warning[-Wunused-parameter]: unused parameter ‘extra’
# 46 | sw_opaque_t extra)
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
# 44| sw_octets text_record,
# 45| sw_uint32 text_record_len,
# 46|-> sw_opaque_t extra)
# 47| {
# 48| sw_text_record_iterator it;
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/browse.c:51: style[unusedVariable]: Unused variable: sval
# 49| sw_int8 name_buf[16];
# 50| sw_int8 key[SW_TEXT_RECORD_MAX_LEN];
# 51|-> sw_int8 sval[SW_TEXT_RECORD_MAX_LEN];
# 52| sw_uint8 oval[SW_TEXT_RECORD_MAX_LEN];
# 53| sw_uint32 oval_len;
Error: COMPILER_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/browse.c:51:81: warning[-Wunused-variable]: unused variable ‘sval’
# 51 | sw_int8 sval[SW_TEXT_RECORD_MAX_LEN];
# | ^~~~
# 49| sw_int8 name_buf[16];
# 50| sw_int8 key[SW_TEXT_RECORD_MAX_LEN];
# 51|-> sw_int8 sval[SW_TEXT_RECORD_MAX_LEN];
# 52| sw_uint8 oval[SW_TEXT_RECORD_MAX_LEN];
# 53| sw_uint32 oval_len;
Error: COMPILER_WARNING (CWE-681):
avahi-0.8/avahi-compat-howl/samples/browse.c: scope_hint: In function ‘my_resolver’
avahi-0.8/avahi-compat-howl/samples/browse.c:58:132: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘sw_ipv4_address_name’ differ in signedness
# 58 | fprintf(stderr, "resolve reply: 0x%x %s %s %s %s %d\n", interface_index, name, type, domain, sw_ipv4_address_name(address, name_buf, 16), port);
# | ^~~~~~~~
# | |
# | sw_int8 * {aka signed char *}
avahi-0.8/avahi-compat-howl/include/corby/orb.h:33: included_from: Included from here.
avahi-0.8/avahi-compat-howl/include/howl.h:35: included_from: Included from here.
avahi-0.8/avahi-compat-howl/include/salt/address.h:104:65: note: expected ‘sw_string’ {aka ‘char *’} but argument is of type ‘sw_int8 *’ {aka ‘signed char *’}
# 104 | sw_string name,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
# 56| sw_discovery_cancel(discovery, oid);
# 57|
# 58|-> fprintf(stderr, "resolve reply: 0x%x %s %s %s %s %d\n", interface_index, name, type, domain, sw_ipv4_address_name(address, name_buf, 16), port);
# 59|
# 60| if ((text_record_len > 0) && (text_record) && (*text_record != '\0'))
Error: COMPILER_WARNING (CWE-681):
avahi-0.8/avahi-compat-howl/samples/browse.c:65:57: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘sw_text_record_iterator_next’ differ in signedness
# 65 | while (sw_text_record_iterator_next(it, key, oval, &oval_len) == SW_OKAY)
# | ^~~
# | |
# | sw_int8 * {aka signed char *}
avahi-0.8/avahi-compat-howl/include/howl.h:41: included_from: Included from here.
avahi-0.8/avahi-compat-howl/include/discovery/text_record.h:112:97: note: expected ‘char *’ but argument is of type ‘sw_int8 *’ {aka ‘signed char *’}
# 112 | char key[SW_TEXT_RECORD_MAX_LEN],
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
# 63| sw_check_okay(err, exit);
# 64|
# 65|-> while (sw_text_record_iterator_next(it, key, oval, &oval_len) == SW_OKAY)
# 66| {
# 67| fprintf(stderr, "Txt: [%s]=[%s] - (%d bytes)\n", key, oval, oval_len);
Error: COMPILER_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/browse.c: scope_hint: In function ‘my_browser’
avahi-0.8/avahi-compat-howl/samples/browse.c:83:89: warning[-Wunused-parameter]: unused parameter ‘oid’
# 83 | sw_discovery_oid oid,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
# 81| my_browser(
# 82| sw_discovery discovery,
# 83|-> sw_discovery_oid oid,
# 84| sw_discovery_browse_status status,
# 85| sw_uint32 interface_index,
Error: COMPILER_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/browse.c:89:97: warning[-Wunused-parameter]: unused parameter ‘extra’
# 89 | sw_opaque_t extra)
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
# 87| sw_const_string type,
# 88| sw_const_string domain,
# 89|-> sw_opaque_t extra)
# 90| {
# 91| sw_discovery_resolve_id rid;
Error: COMPILER_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/publish.c:35:89: warning[-Wunused-parameter]: unused parameter ‘discovery’
# 35 | sw_discovery discovery,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
# 33| static sw_result HOWL_API
# 34| my_service_reply(
# 35|-> sw_discovery discovery,
# 36| sw_discovery_oid oid,
# 37| sw_discovery_publish_status status,
Error: COMPILER_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/publish.c:36:89: warning[-Wunused-parameter]: unused parameter ‘oid’
# 36 | sw_discovery_oid oid,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
# 34| my_service_reply(
# 35| sw_discovery discovery,
# 36|-> sw_discovery_oid oid,
# 37| sw_discovery_publish_status status,
# 38| sw_opaque extra)
Error: COMPILER_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/publish.c:38:97: warning[-Wunused-parameter]: unused parameter ‘extra’
# 38 | sw_opaque extra)
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
# 36| sw_discovery_oid oid,
# 37| sw_discovery_publish_status status,
# 38|-> sw_opaque extra)
# 39| {
# 40| static sw_string
Error: COMPILER_WARNING (CWE-704):
avahi-0.8/avahi-compat-howl/samples/publish.c: scope_hint: In function ‘my_service_reply’
avahi-0.8/avahi-compat-howl/samples/publish.c:43:17: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 43 | "Started",
# | ^~~~~~~~~
# 41| status_text[] =
# 42| {
# 43|-> "Started",
# 44| "Stopped",
# 45| "Name Collision",
Error: COMPILER_WARNING (CWE-704):
avahi-0.8/avahi-compat-howl/samples/publish.c:44:17: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 44 | "Stopped",
# | ^~~~~~~~~
# 42| {
# 43| "Started",
# 44|-> "Stopped",
# 45| "Name Collision",
# 46| "Invalid"
Error: COMPILER_WARNING (CWE-704):
avahi-0.8/avahi-compat-howl/samples/publish.c:45:17: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 45 | "Name Collision",
# | ^~~~~~~~~~~~~~~~
# 43| "Started",
# 44| "Stopped",
# 45|-> "Name Collision",
# 46| "Invalid"
# 47| };
Error: COMPILER_WARNING (CWE-704):
avahi-0.8/avahi-compat-howl/samples/publish.c:46:17: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 46 | "Invalid"
# | ^~~~~~~~~
# 44| "Stopped",
# 45| "Name Collision",
# 46|-> "Invalid"
# 47| };
# 48|
Error: COMPILER_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/query.c:36:105: warning[-Wunused-parameter]: unused parameter ‘session’
# 36 | sw_discovery session,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
# 34| static sw_result HOWL_API
# 35| query_record_reply(
# 36|-> sw_discovery session,
# 37| sw_discovery_oid oid,
# 38| sw_discovery_query_record_status status,
Error: COMPILER_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/query.c:37:105: warning[-Wunused-parameter]: unused parameter ‘oid’
# 37 | sw_discovery_oid oid,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
# 35| query_record_reply(
# 36| sw_discovery session,
# 37|-> sw_discovery_oid oid,
# 38| sw_discovery_query_record_status status,
# 39| sw_uint32 interface_index,
Error: COMPILER_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/query.c:38:81: warning[-Wunused-parameter]: unused parameter ‘status’
# 38 | sw_discovery_query_record_status status,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
# 36| sw_discovery session,
# 37| sw_discovery_oid oid,
# 38|-> sw_discovery_query_record_status status,
# 39| sw_uint32 interface_index,
# 40| sw_const_string fullname,
Error: COMPILER_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/query.c:43:113: warning[-Wunused-parameter]: unused parameter ‘rrdatalen’
# 43 | sw_uint16 rrdatalen,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
# 41| sw_uint16 rrtype,
# 42| sw_uint16 rrclass,
# 43|-> sw_uint16 rrdatalen,
# 44| sw_const_octets rrdata,
# 45| sw_uint32 ttl,
Error: COMPILER_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/query.c:45:113: warning[-Wunused-parameter]: unused parameter ‘ttl’
# 45 | sw_uint32 ttl,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
# 43| sw_uint16 rrdatalen,
# 44| sw_const_octets rrdata,
# 45|-> sw_uint32 ttl,
# 46| sw_opaque extra)
# 47| {
Error: COMPILER_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/query.c:46:113: warning[-Wunused-parameter]: unused parameter ‘extra’
# 46 | sw_opaque extra)
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
# 44| sw_const_octets rrdata,
# 45| sw_uint32 ttl,
# 46|-> sw_opaque extra)
# 47| {
# 48| sw_ipv4_address address;
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/query.c:48: style[unusedVariable]: Unused variable: address
# 46| sw_opaque extra)
# 47| {
# 48|-> sw_ipv4_address address;
# 49|
# 50| fprintf(stderr, "interface index = 0x%x, fullname is %s\n", interface_index, fullname);
Error: COMPILER_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/query.c:48:25: warning[-Wunused-variable]: unused variable ‘address’
# 48 | sw_ipv4_address address;
# | ^~~~~~~
# 46| sw_opaque extra)
# 47| {
# 48|-> sw_ipv4_address address;
# 49|
# 50| fprintf(stderr, "interface index = 0x%x, fullname is %s\n", interface_index, fullname);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-compat-howl/samples/query.c:54: style[shadowVariable]: Local variable 'address' shadows outer variable
# 52| if ((rrtype == 1) && (rrclass == 1))
# 53| {
# 54|-> sw_ipv4_address address;
# 55| sw_char name[16];
# 56|
Error: COMPILER_WARNING (CWE-694):
avahi-0.8/avahi-compat-howl/samples/query.c: scope_hint: In function ‘query_record_reply’
avahi-0.8/avahi-compat-howl/samples/query.c:54:33: warning[-Wshadow]: declaration of ‘address’ shadows a previous local
# 54 | sw_ipv4_address address;
# | ^~~~~~~
avahi-0.8/avahi-compat-howl/samples/query.c:48:25: note: shadowed declaration is here
# 48 | sw_ipv4_address address;
# | ^~~~~~~
# 52| if ((rrtype == 1) && (rrclass == 1))
# 53| {
# 54|-> sw_ipv4_address address;
# 55| sw_char name[16];
# 56|
Error: COMPILER_WARNING (CWE-681):
avahi-0.8/avahi-compat-howl/samples/query.c:59:82: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘sw_ipv4_address_name’ differ in signedness
# 59 | fprintf(stderr, "address is %s\n", sw_ipv4_address_name(address, name, sizeof(name)));
# | ^~~~
# | |
# | sw_int8 * {aka signed char *}
avahi-0.8/avahi-compat-howl/include/corby/orb.h:33: included_from: Included from here.
avahi-0.8/avahi-compat-howl/include/howl.h:35: included_from: Included from here.
avahi-0.8/avahi-compat-howl/include/salt/address.h:104:65: note: expected ‘sw_string’ {aka ‘char *’} but argument is of type ‘sw_int8 *’ {aka ‘signed char *’}
# 104 | sw_string name,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
# 57| sw_ipv4_address_init_from_saddr(&address, *(sw_saddr*) rrdata);
# 58|
# 59|-> fprintf(stderr, "address is %s\n", sw_ipv4_address_name(address, name, sizeof(name)));
# 60| }
# 61|
Error: COMPILER_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/resolve.c:46:73: warning[-Wunused-parameter]: unused parameter ‘extra’
# 46 | sw_opaque_t extra)
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
# 44| sw_octets text_record,
# 45| sw_uint32 text_record_len,
# 46|-> sw_opaque_t extra)
# 47| {
# 48| sw_text_record_iterator it;
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/resolve.c:51: style[unusedVariable]: Unused variable: sval
# 49| sw_int8 name_buf[16];
# 50| sw_int8 key[SW_TEXT_RECORD_MAX_LEN];
# 51|-> sw_int8 sval[SW_TEXT_RECORD_MAX_LEN];
# 52| sw_uint8 oval[SW_TEXT_RECORD_MAX_LEN];
# 53| sw_uint32 oval_len;
Error: COMPILER_WARNING (CWE-563):
avahi-0.8/avahi-compat-howl/samples/resolve.c:51:81: warning[-Wunused-variable]: unused variable ‘sval’
# 51 | sw_int8 sval[SW_TEXT_RECORD_MAX_LEN];
# | ^~~~
# 49| sw_int8 name_buf[16];
# 50| sw_int8 key[SW_TEXT_RECORD_MAX_LEN];
# 51|-> sw_int8 sval[SW_TEXT_RECORD_MAX_LEN];
# 52| sw_uint8 oval[SW_TEXT_RECORD_MAX_LEN];
# 53| sw_uint32 oval_len;
Error: COMPILER_WARNING (CWE-681):
avahi-0.8/avahi-compat-howl/samples/resolve.c: scope_hint: In function ‘my_resolver’
avahi-0.8/avahi-compat-howl/samples/resolve.c:58:132: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘sw_ipv4_address_name’ differ in signedness
# 58 | fprintf(stderr, "resolve reply: 0x%x %s %s %s %s %d\n", interface_index, name, type, domain, sw_ipv4_address_name(address, name_buf, 16), port);
# | ^~~~~~~~
# | |
# | sw_int8 * {aka signed char *}
avahi-0.8/avahi-compat-howl/include/corby/orb.h:33: included_from: Included from here.
avahi-0.8/avahi-compat-howl/include/howl.h:35: included_from: Included from here.
avahi-0.8/avahi-compat-howl/include/salt/address.h:104:65: note: expected ‘sw_string’ {aka ‘char *’} but argument is of type ‘sw_int8 *’ {aka ‘signed char *’}
# 104 | sw_string name,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
# 56| sw_discovery_cancel(discovery, oid);
# 57|
# 58|-> fprintf(stderr, "resolve reply: 0x%x %s %s %s %s %d\n", interface_index, name, type, domain, sw_ipv4_address_name(address, name_buf, 16), port);
# 59|
# 60| if ((text_record_len > 0) && (text_record) && (*text_record != '\0'))
Error: COMPILER_WARNING (CWE-681):
avahi-0.8/avahi-compat-howl/samples/resolve.c:65:57: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘sw_text_record_iterator_next’ differ in signedness
# 65 | while (sw_text_record_iterator_next(it, key, oval, &oval_len) == SW_OKAY)
# | ^~~
# | |
# | sw_int8 * {aka signed char *}
avahi-0.8/avahi-compat-howl/include/howl.h:41: included_from: Included from here.
avahi-0.8/avahi-compat-howl/include/discovery/text_record.h:112:97: note: expected ‘char *’ but argument is of type ‘sw_int8 *’ {aka ‘signed char *’}
# 112 | char key[SW_TEXT_RECORD_MAX_LEN],
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
# 63| sw_check_okay(err, exit);
# 64|
# 65|-> while (sw_text_record_iterator_next(it, key, oval, &oval_len) == SW_OKAY)
# 66| {
# 67| fprintf(stderr, "key = %s, data is %d bytes\n", key, oval_len);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-compat-howl/text.c:127: style[constParameterPointer]: Parameter 'val' can be declared as pointer to const
# 125| sw_text_record self,
# 126| sw_const_string key,
# 127|-> sw_octets val,
# 128| sw_uint32 len) {
# 129|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-compat-howl/text.c:192: style[constParameterPointer]: Parameter 'text_record' can be declared as pointer to const
# 190| sw_result sw_text_record_iterator_init(
# 191| sw_text_record_iterator * self,
# 192|-> sw_octets text_record,
# 193| sw_uint32 text_record_len) {
# 194|
Error: COMPILER_WARNING:
avahi-0.8/avahi-compat-howl/unsupported.c: scope_hint: In function 'sw_strerror'
avahi-0.8/avahi-compat-howl/unsupported.c:62:17: warning[-Wold-style-definition]: old-style function definition
# 60|
# 61| AVAHI_GCC_NORETURN
# 62|-> sw_const_string sw_strerror(/* howl sucks */) {
# 63| AVAHI_WARN_UNSUPPORTED_ABORT;
# 64| }
Error: COMPILER_WARNING:
avahi-0.8/avahi-compat-howl/unsupported.c: scope_hint: At top level
avahi-0.8/avahi-compat-howl/unsupported.c:62:17: warning[-Wstrict-prototypes]: function declaration isn't a prototype
# 62 | sw_const_string sw_strerror(/* howl sucks */) {
# | ^~~~~~~~~~~
# 60|
# 61| AVAHI_GCC_NORETURN
# 62|-> sw_const_string sw_strerror(/* howl sucks */) {
# 63| AVAHI_WARN_UNSUPPORTED_ABORT;
# 64| }
Error: COMPILER_WARNING:
avahi-0.8/avahi-compat-libdns_sd/compat.c:47: included_from: Included from here.
avahi-0.8/avahi-compat-libdns_sd/compat.c: scope_hint: In function 'DNSServiceBrowse'
avahi-0.8/avahi-compat-libdns_sd/warn.h:33:82: warning[-Wpedantic]: ISO C does not support '__FUNCTION__' predefined identifier
# 33 | #define AVAHI_WARN_UNSUPPORTED do { avahi_warn_linkage(); avahi_warn_unsupported(__FUNCTION__); } while(0)
# | ^~~~~~~~~~~~
avahi-0.8/avahi-compat-libdns_sd/compat.c:622:9: note: in expansion of macro 'AVAHI_WARN_UNSUPPORTED'
# 622 | AVAHI_WARN_UNSUPPORTED;
# | ^~~~~~~~~~~~~~~~~~~~~~
# 31|
# 32| #define AVAHI_WARN_LINKAGE do { avahi_warn_linkage(); } while(0)
# 33|-> #define AVAHI_WARN_UNSUPPORTED do { avahi_warn_linkage(); avahi_warn_unsupported(__FUNCTION__); } while(0)
# 34| #define AVAHI_WARN_UNSUPPORTED_ABORT do { AVAHI_WARN_UNSUPPORTED; abort(); } while(0)
# 35|
Error: COMPILER_WARNING:
avahi-0.8/avahi-compat-libdns_sd/compat.c:47: included_from: Included from here.
avahi-0.8/avahi-compat-libdns_sd/compat.c: scope_hint: In function ‘DNSServiceBrowse’
avahi-0.8/avahi-compat-libdns_sd/warn.h:33:82: warning[-Wpedantic]: ISO C does not support ‘__FUNCTION__’ predefined identifier
# 33 | #define AVAHI_WARN_UNSUPPORTED do { avahi_warn_linkage(); avahi_warn_unsupported(__FUNCTION__); } while(0)
# | ^~~~~~~~~~~~
avahi-0.8/avahi-compat-libdns_sd/compat.c:622:9: note: in expansion of macro ‘AVAHI_WARN_UNSUPPORTED’
# 622 | AVAHI_WARN_UNSUPPORTED;
# | ^~~~~~~~~~~~~~~~~~~~~~
# 31|
# 32| #define AVAHI_WARN_LINKAGE do { avahi_warn_linkage(); } while(0)
# 33|-> #define AVAHI_WARN_UNSUPPORTED do { avahi_warn_linkage(); avahi_warn_unsupported(__FUNCTION__); } while(0)
# 34| #define AVAHI_WARN_UNSUPPORTED_ABORT do { AVAHI_WARN_UNSUPPORTED; abort(); } while(0)
# 35|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/announce.c:313: style[constVariablePointer]: Variable 'a' can be declared as pointer to const
# 311|
# 312| int avahi_entry_is_registered(AvahiServer *s, AvahiEntry *e, AvahiInterface *i) {
# 313|-> AvahiAnnouncer *a;
# 314|
# 315| assert(s);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/announce.c:330: style[constVariablePointer]: Variable 'a' can be declared as pointer to const
# 328|
# 329| int avahi_entry_is_probing(AvahiServer *s, AvahiEntry *e, AvahiInterface *i) {
# 330|-> AvahiAnnouncer *a;
# 331|
# 332| assert(s);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/announce.c:447: style[duplicateConditionalAssign]: Assignment 'a->state=AVAHI_WAITING' is redundant with condition 'a->state==AVAHI_WAITING'.
# 445|
# 446| /* We were waiting, but were not probing before, so we continue waiting */
# 447|-> a->state = AVAHI_WAITING;
# 448|
# 449| else if (e->flags & AVAHI_PUBLISH_NO_ANNOUNCE)
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/avahi-test.c:56: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'dump_line' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
# 54| }
# 55|
# 56|-> static void dump_line(const char *text, AVAHI_GCC_UNUSED void* userdata) {
# 57| printf("%s\n", text);
# 58| }
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/avahi-test.c:95: style[constParameterCallback]: Parameter 'record' can be declared as pointer to const. However it seems that 'record_browser_callback' is a callback function, if 'record' is declared with const you might also need to cast function pointer(s).
# 93| AvahiProtocol protocol,
# 94| AvahiBrowserEvent event,
# 95|-> AvahiRecord *record,
# 96| AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
# 97| AVAHI_GCC_UNUSED void* userdata) {
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/avahi-test.c:98: style[variableScope]: The scope of the variable 't' can be reduced.
# 96| AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
# 97| AVAHI_GCC_UNUSED void* userdata) {
# 98|-> char *t;
# 99|
# 100| assert(r);
Error: CPPCHECK_WARNING (CWE-475):
avahi-0.8/avahi-core/avahi-test.c:169: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
# 167| }
# 168|
# 169|-> if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, service_name, "_http._tcp", NULL, NULL, 80, "foo", NULL) < 0) {
# 170| avahi_log_error("Failed to add HTTP service");
# 171| goto fail;
Error: CPPCHECK_WARNING (CWE-475):
avahi-0.8/avahi-core/avahi-test.c:174: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
# 172| }
# 173|
# 174|-> if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, service_name, "_ftp._tcp", NULL, NULL, 21, "foo", NULL) < 0) {
# 175| avahi_log_error("Failed to add FTP service");
# 176| goto fail;
Error: CPPCHECK_WARNING (CWE-475):
avahi-0.8/avahi-core/avahi-test.c:179: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
# 177| }
# 178|
# 179|-> if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0,service_name, "_webdav._tcp", NULL, NULL, 80, "foo", NULL) < 0) {
# 180| avahi_log_error("Failed to add WEBDAV service");
# 181| goto fail;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/browse.c:163: style[constParameterPointer]: Parameter 'key' can be declared as pointer to const
# 161| AvahiProtocol protocol,
# 162| AvahiLookupFlags flags,
# 163|-> AvahiKey *key) {
# 164|
# 165| AvahiSRBLookup *l;
Error: CPPCHECK_WARNING (CWE-683):
avahi-0.8/avahi-core/cache.c:114: warning[funcArgOrderDifferent]: Function 'avahi_cache_walk' argument order different: declaration 'c, pattern, , userdata, , ' definition 'c, pattern, c, pattern, e, userdata'
# 112| }
# 113|
# 114|-> void* avahi_cache_walk(AvahiCache *c, AvahiKey *pattern, AvahiCacheWalkCallback cb, void* userdata) {
# 115| void* ret;
# 116|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/cache.c:122: style[shadowArgument]: Local variable 'e' shadows outer argument
# 120|
# 121| if (avahi_key_is_pattern(pattern)) {
# 122|-> AvahiCacheEntry *e, *n;
# 123|
# 124| for (e = c->entries; e; e = n) {
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/cache.c:133: style[shadowArgument]: Local variable 'e' shadows outer argument
# 131|
# 132| } else {
# 133|-> AvahiCacheEntry *e, *n;
# 134|
# 135| for (e = lookup_key(c, pattern); e; e = n) {
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/cache.c:146: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'lookup_record_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
# 144| }
# 145|
# 146|-> static void* lookup_record_callback(AvahiCache *c, AvahiKey *pattern, AvahiCacheEntry *e, void *userdata) {
# 147| assert(c);
# 148| assert(pattern);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/conformance-test.c:50: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'dump_line' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
# 48| static const AvahiPoll *poll_api;
# 49|
# 50|-> static void dump_line(const char *text, AVAHI_GCC_UNUSED void* userdata) {
# 51| printf("%s\n", text);
# 52| }
Error: CPPCHECK_WARNING (CWE-475):
avahi-0.8/avahi-core/conformance-test.c:79: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
# 77| group = avahi_s_entry_group_new(avahi, entry_group_callback, NULL);
# 78|
# 79|-> avahi_server_add_service(avahi, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_http._tcp", NULL, NULL, 80, "foo", NULL);
# 80| avahi_s_entry_group_commit(group);
# 81|
Error: GCC_ANALYZER_WARNING (CWE-479):
avahi-0.8/avahi-core/dns-spin-test.c: scope_hint: In function ‘fail’
avahi-0.8/avahi-core/dns-spin-test.c:76:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
avahi-0.8/avahi-core/dns-spin-test.c:76:5: note: ‘_exit’ is a possible signal-safe alternative for ‘exit’
# 74| printf("\n");
# 75|
# 76|-> exit(EXIT_FAILURE);
# 77| }
# 78|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/dns-test.c:50: warning[assignmentInAssert]: Assert statement modifies 'a'.
# 48| p = avahi_dns_packet_new(0);
# 49|
# 50|-> assert(avahi_dns_packet_append_name(p, a = "Ahello.hello.hello.de."));
# 51| assert(avahi_dns_packet_append_name(p, b = "Bthis is a test.hello.de."));
# 52| assert(avahi_dns_packet_append_name(p, c = "Cthis\\.is\\.a\\.test\\.with\\.dots.hello.de."));
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/dns-test.c:51: warning[assignmentInAssert]: Assert statement modifies 'b'.
# 49|
# 50| assert(avahi_dns_packet_append_name(p, a = "Ahello.hello.hello.de."));
# 51|-> assert(avahi_dns_packet_append_name(p, b = "Bthis is a test.hello.de."));
# 52| assert(avahi_dns_packet_append_name(p, c = "Cthis\\.is\\.a\\.test\\.with\\.dots.hello.de."));
# 53| assert(avahi_dns_packet_append_name(p, d = "Dthis\\\\is another test.hello.de."));
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/dns-test.c:52: warning[assignmentInAssert]: Assert statement modifies 'c'.
# 50| assert(avahi_dns_packet_append_name(p, a = "Ahello.hello.hello.de."));
# 51| assert(avahi_dns_packet_append_name(p, b = "Bthis is a test.hello.de."));
# 52|-> assert(avahi_dns_packet_append_name(p, c = "Cthis\\.is\\.a\\.test\\.with\\.dots.hello.de."));
# 53| assert(avahi_dns_packet_append_name(p, d = "Dthis\\\\is another test.hello.de."));
# 54|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/dns-test.c:53: warning[assignmentInAssert]: Assert statement modifies 'd'.
# 51| assert(avahi_dns_packet_append_name(p, b = "Bthis is a test.hello.de."));
# 52| assert(avahi_dns_packet_append_name(p, c = "Cthis\\.is\\.a\\.test\\.with\\.dots.hello.de."));
# 53|-> assert(avahi_dns_packet_append_name(p, d = "Dthis\\\\is another test.hello.de."));
# 54|
# 55| avahi_hexdump(AVAHI_DNS_PACKET_DATA(p), p->size);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/dns-test.c:84: warning[assignmentInAssert]: Assert statement modifies 'l'.
# 82|
# 83| /* Serialize it into a blob */
# 84|-> assert((l = avahi_rdata_serialize(r, rdata, sizeof(rdata))) != (size_t) -1);
# 85|
# 86| /* Print it */
Error: COMPILER_WARNING (CWE-569):
avahi-0.8/avahi-core/dns-test.c: scope_hint: In function ‘main’
avahi-0.8/avahi-core/dns-test.c:104:5: warning[-Wparentheses]: suggest parentheses around assignment used as truth value
# 104 | assert(r->data.generic.data = avahi_memdup("HALLO", r->data.generic.size = 5));
# | ^~~~~~
# 102| assert(r);
# 103|
# 104|-> assert(r->data.generic.data = avahi_memdup("HALLO", r->data.generic.size = 5));
# 105|
# 106| m = avahi_record_to_string(r);
Error: CPPCHECK_WARNING (CWE-570):
avahi-0.8/avahi-core/dns.c:43: style[unsignedLessThanZero]: Checking if unsigned expression 'mtu' is less than zero.
# 41| size_t max_size;
# 42|
# 43|-> if (mtu <= 0)
# 44| max_size = AVAHI_DNS_PACKET_SIZE_MAX;
# 45| else if (mtu >= AVAHI_DNS_PACKET_EXTRA_SIZE)
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/dns.c:156: style[constParameterCallback]: Parameter 'key' can be declared as pointer to const. However it seems that 'name_table_cleanup' is a callback function, if 'key' is declared with const you might also need to cast function pointer(s).
# 154|
# 155|
# 156|-> static void name_table_cleanup(void *key, void *value, void *user_data) {
# 157| AvahiDnsPacket *p = user_data;
# 158|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/dns.c:179: style[constVariablePointer]: Variable 'prev' can be declared as pointer to const
# 177|
# 178| while (*name) {
# 179|-> uint8_t* prev;
# 180| const char *pname;
# 181| char label[64], *u;
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-core/dns.c:363: style[unreadVariable]: Variable 'idx' is assigned a value that is never used.
# 361|
# 362| if (!n) {
# 363|-> idx++;
# 364| if (!compressed)
# 365| ret++;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/dns.c:433: style[constVariablePointer]: Variable 'd' can be declared as pointer to const
# 431|
# 432| int avahi_dns_packet_consume_uint16(AvahiDnsPacket *p, uint16_t *ret_v) {
# 433|-> uint8_t *d;
# 434|
# 435| assert(p);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/dns.c:449: style[constVariablePointer]: Variable 'd' can be declared as pointer to const
# 447|
# 448| int avahi_dns_packet_consume_uint32(AvahiDnsPacket *p, uint32_t *ret_v) {
# 449|-> uint8_t* d;
# 450|
# 451| assert(p);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/dns.c:785: style[constVariablePointer]: Variable 'start' can be declared as pointer to const
# 783|
# 784| uint8_t* avahi_dns_packet_append_record(AvahiDnsPacket *p, AvahiRecord *r, int cache_flush, unsigned max_ttl) {
# 785|-> uint8_t *t, *l, *start;
# 786| size_t size;
# 787|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/entry.c:421: style[constVariablePointer]: Variable 'e' can be declared as pointer to const
# 419| const char *dest) {
# 420|
# 421|-> AvahiEntry *e;
# 422|
# 423| assert(s);
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-core/entry.c:425: style[unreadVariable]: Variable 'e' is assigned a value that is never used.
# 423| assert(s);
# 424|
# 425|-> if (!(e = server_add_ptr_internal(s, g, interface, protocol, flags, ttl, name, dest)))
# 426| return avahi_server_errno(s);
# 427|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/entry.c:700: style[constParameterPointer]: Parameter 'strlst' can be declared as pointer to const
# 698| const char *host,
# 699| uint16_t port,
# 700|-> AvahiStringList *strlst) {
# 701|
# 702| assert(s);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/entry.c:745: style[constVariablePointer]: Variable 'e' can be declared as pointer to const
# 743| char svc_name[AVAHI_DOMAIN_NAME_MAX];
# 744| int ret = AVAHI_OK;
# 745|-> AvahiEntry *e;
# 746|
# 747| assert(s);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/entry.c:798: style[constParameterPointer]: Parameter 'strlst' can be declared as pointer to const
# 796| const char *type,
# 797| const char *domain,
# 798|-> AvahiStringList *strlst) {
# 799|
# 800| return server_update_service_txt_strlst_nocopy(s, g, interface, protocol, flags, name, type, domain, avahi_string_list_copy(strlst));
Error: COMPILER_WARNING:
avahi-0.8/avahi-core/entry.c: scope_hint: In function 'server_add_dns_server_name'
avahi-0.8/avahi-core/entry.c:931:32: warning[-Wformat-truncation=]: '%s' directive output may be truncated writing up to 1013 bytes into a region of size between 997 and 1001
# 931 | snprintf(t, sizeof(t), "%s.%s", type == AVAHI_DNS_SERVER_RESOLVE ? "_domain._udp" : "_dns-update._udp", normalized_d);
# | ^~ ~~~~~~~~~~~~
/usr/include/bits/stdio2.h:68:10: note: '__snprintf_chk' output between 14 and 1031 bytes into a destination of size 1014
# 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 69 | __glibc_objsize (__s), __fmt,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 70 | __va_arg_pack ());
# | ~~~~~~~~~~~~~~~~~
# 929| AVAHI_ASSERT_TRUE(avahi_normalize_name(domain, normalized_d, sizeof(normalized_d)));
# 930|
# 931|-> snprintf(t, sizeof(t), "%s.%s", type == AVAHI_DNS_SERVER_RESOLVE ? "_domain._udp" : "_dns-update._udp", normalized_d);
# 932|
# 933| if (!(r = avahi_record_new_full(t, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_SRV, AVAHI_DEFAULT_TTL_HOST_NAME))) {
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/entry.c:962: style[constVariablePointer]: Variable 's_entry' can be declared as pointer to const
# 960| AvahiRecord *r;
# 961| char n[64], h[64];
# 962|-> AvahiEntry *a_entry, *s_entry;
# 963|
# 964| assert(s);
Error: COMPILER_WARNING:
avahi-0.8/avahi-core/entry.c: scope_hint: In function 'avahi_server_add_dns_server_address'
avahi-0.8/avahi-core/entry.c:982:36: warning[-Wformat-truncation=]: '%s' directive output may be truncated writing up to 63 bytes into a region of size 61
# 982 | snprintf(n, sizeof(n), "ip-%s.%s", h, domain);
# | ^~ ~
/usr/include/bits/stdio2.h:68:10: note: '__snprintf_chk' output 5 or more bytes (assuming 68) into a destination of size 64
# 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 69 | __glibc_objsize (__s), __fmt,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 70 | __va_arg_pack ());
# | ~~~~~~~~~~~~~~~~~
# 980| if (address->proto == AVAHI_PROTO_INET) {
# 981| hexstring(h, sizeof(h), &address->data, sizeof(AvahiIPv4Address));
# 982|-> snprintf(n, sizeof(n), "ip-%s.%s", h, domain);
# 983| r = avahi_record_new_full(n, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_A, AVAHI_DEFAULT_TTL_HOST_NAME);
# 984| r->data.a.address = address->data.ipv4;
Error: COMPILER_WARNING:
avahi-0.8/avahi-core/entry.c: scope_hint: In function 'avahi_server_add_dns_server_address'
avahi-0.8/avahi-core/entry.c:987:37: warning[-Wformat-truncation=]: '%s' directive output may be truncated writing up to 63 bytes into a region of size 60
# 987 | snprintf(n, sizeof(n), "ip6-%s.%s", h, domain);
# | ^~ ~
/usr/include/bits/stdio2.h:68:10: note: '__snprintf_chk' output 6 or more bytes (assuming 69) into a destination of size 64
# 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 69 | __glibc_objsize (__s), __fmt,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 70 | __va_arg_pack ());
# | ~~~~~~~~~~~~~~~~~
# 985| } else {
# 986| hexstring(h, sizeof(h), &address->data, sizeof(AvahiIPv6Address));
# 987|-> snprintf(n, sizeof(n), "ip6-%s.%s", h, domain);
# 988| r = avahi_record_new_full(n, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_AAAA, AVAHI_DEFAULT_TTL_HOST_NAME);
# 989| r->data.aaaa.address = address->data.ipv6;
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-core/entry.c:1001: style[unreadVariable]: Variable 's_entry' is assigned a value that is never used.
# 999| return avahi_server_errno(s);
# 1000|
# 1001|-> if (!(s_entry = server_add_dns_server_name(s, g, interface, protocol, flags, domain, type, n, port))) {
# 1002| if (!(flags & AVAHI_PUBLISH_UPDATE))
# 1003| avahi_entry_free(s, a_entry);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/hashmap.c:115: style[constVariablePointer]: Variable 'e' can be declared as pointer to const
# 113|
# 114| void* avahi_hashmap_lookup(AvahiHashmap *m, const void *key) {
# 115|-> Entry *e;
# 116|
# 117| assert(m);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/iface-linux.c:66: style[constParameterCallback]: Parameter 'nl' can be declared as pointer to const. However it seems that 'netlink_callback' is a callback function, if 'nl' is declared with const you might also need to cast function pointer(s).
# 64| }
# 65|
# 66|-> static void netlink_callback(AvahiNetlink *nl, struct nlmsghdr *n, void* userdata) {
# 67| AvahiInterfaceMonitor *m = userdata;
# 68|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/iface-linux.c:162: style[constVariablePointer]: Variable 'ifinfomsg' can be declared as pointer to const
# 160| /* An interface has been removed */
# 161|
# 162|-> struct ifinfomsg *ifinfomsg = NLMSG_DATA(n);
# 163| AvahiHwInterface *hw;
# 164|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/iface-linux.c:184: style[constVariablePointer]: Variable 'r' can be declared as pointer to const
# 182| struct rtattr *a = NULL;
# 183| size_t l;
# 184|-> AvahiAddress raddr, rlocal, *r;
# 185| int raddr_valid = 0, rlocal_valid = 0;
# 186|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/iface-linux.c:326: style[constVariablePointer]: Variable 'e' can be declared as pointer to const
# 324| } else if (n->nlmsg_type == NLMSG_ERROR &&
# 325| (n->nlmsg_seq == m->osdep.query_link_seq || n->nlmsg_seq == m->osdep.query_addr_seq)) {
# 326|-> struct nlmsgerr *e = NLMSG_DATA (n);
# 327|
# 328| /* Some kind of error happened. Let's just tell the user and
Error: COMPILER_WARNING:
avahi-0.8/avahi-core/iface.c: scope_hint: In function 'avahi_hw_interface_update_rrs'
avahi-0.8/avahi-core/iface.c:143:45: warning[-Wformat-truncation=]: ' [' directive output may be truncated writing 2 bytes into a region of size between 1 and 64
# 143 | snprintf(name, sizeof(name), "%s [%s]", unescaped, mac);
# | ^~
/usr/include/bits/stdio2.h:68:10: note: '__snprintf_chk' output between 4 and 322 bytes into a destination of size 64
# 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 69 | __glibc_objsize (__s), __fmt,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 70 | __va_arg_pack ());
# | ~~~~~~~~~~~~~~~~~
# 141| avahi_unescape_label(&p, unescaped, sizeof(unescaped));
# 142| avahi_format_mac_address(mac, sizeof(mac), hw->mac_address, hw->mac_address_size);
# 143|-> snprintf(name, sizeof(name), "%s [%s]", unescaped, mac);
# 144|
# 145| if (avahi_server_add_service(m->server, hw->entry_group, hw->index, AVAHI_PROTO_UNSPEC, 0, name, "_workstation._tcp", NULL, NULL, 9, NULL) < 0) {
Error: CPPCHECK_WARNING (CWE-475):
avahi-0.8/avahi-core/iface.c:145: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
# 143| snprintf(name, sizeof(name), "%s [%s]", unescaped, mac);
# 144|
# 145|-> if (avahi_server_add_service(m->server, hw->entry_group, hw->index, AVAHI_PROTO_UNSPEC, 0, name, "_workstation._tcp", NULL, NULL, 9, NULL) < 0) {
# 146| avahi_log_warn(__FILE__": avahi_server_add_service() failed: %s", avahi_strerror(m->server->error));
# 147| avahi_s_entry_group_free(hw->entry_group);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/iface.c:232: style[constVariablePointer]: Variable 'found' can be declared as pointer to const
# 230|
# 231| static int interface_mdns_mcast_rejoin(AvahiInterface *i) {
# 232|-> AvahiInterfaceAddress *a, *usable = NULL, *found = NULL;
# 233| assert(i);
# 234|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/netlink.c:50: style[constVariablePointer]: Variable 'cred' can be declared as pointer to const
# 48| struct msghdr smsg;
# 49| struct cmsghdr *cmsg;
# 50|-> struct ucred *cred;
# 51| struct iovec iov;
# 52| struct nlmsghdr *p;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/querier.c:146: style[constParameterPointer]: Parameter 'key' can be declared as pointer to const
# 144| }
# 145|
# 146|-> void avahi_querier_remove(AvahiInterface *i, AvahiKey *key) {
# 147| AvahiQuerier *q;
# 148|
Error: CPPCHECK_WARNING (CWE-570):
avahi-0.8/avahi-core/rr.c:550: style[knownConditionTrueFalse]: Condition 'al==c' is always false
# 548| return 0;
# 549| else
# 550|-> return al == c ? -1 : 1;
# 551| }
# 552|
Error: CPPCHECK_WARNING (CWE-570):
avahi-0.8/avahi-core/rr.c:710: style[unsignedLessThanZero]: Checking if unsigned expression 'strlst->size' is less than zero.
# 708|
# 709| for (strlst = r->data.txt.string_list; strlst; strlst = strlst->next) {
# 710|-> if (strlst->size > 255 || strlst->size <= 0)
# 711| return 0;
# 712|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/server.c:516: style[constVariablePointer]: Variable 'r' can be declared as pointer to const
# 514| static void* reflect_cache_walk_callback(AvahiCache *c, AvahiKey *pattern, AvahiCacheEntry *e, void* userdata) {
# 515| AvahiServer *s = userdata;
# 516|-> AvahiRecord* r;
# 517|
# 518| assert(c);
Error: CPPCHECK_WARNING (CWE-570):
avahi-0.8/avahi-core/server.c:949: style[unsignedLessThanZero]: Checking if unsigned expression 'port' is less than zero.
# 947| }
# 948|
# 949|-> if (port <= 0) {
# 950| /* This fixes RHBZ #475394 */
# 951| avahi_log_debug("Received packet from invalid source port %u.", (unsigned) port);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/server.c:1817: style[constVariablePointer]: Variable 'e' can be declared as pointer to const
# 1815| int avahi_server_is_service_local(AvahiServer *s, AvahiIfIndex interface, AvahiProtocol protocol, const char *name) {
# 1816| AvahiKey *key = NULL;
# 1817|-> AvahiEntry *e;
# 1818|
# 1819| assert(s);
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-core/socket.c:226: style[unusedVariable]: Unused variable: yes
# 224|
# 225| static int ipv4_pktinfo(int fd) {
# 226|-> int yes;
# 227|
# 228| #ifdef IP_PKTINFO
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-core/socket.c:272: style[unusedVariable]: Unused variable: yes
# 270|
# 271| static int ipv6_pktinfo(int fd) {
# 272|-> int yes;
# 273|
# 274| #ifdef IPV6_RECVPKTINFO
Error: CPPCHECK_WARNING (CWE-570):
avahi-0.8/avahi-core/socket.c:351: style[knownConditionTrueFalse]: Condition 'ipv4_pktinfo(fd)<0' is always false
# 349| goto fail;
# 350|
# 351|-> if (ipv4_pktinfo (fd) < 0)
# 352| goto fail;
# 353|
Error: CPPCHECK_WARNING (CWE-570):
avahi-0.8/avahi-core/socket.c:421: style[knownConditionTrueFalse]: Condition 'ipv6_pktinfo(fd)<0' is always false
# 419| goto fail;
# 420|
# 421|-> if (ipv6_pktinfo(fd) < 0)
# 422| goto fail;
# 423|
Error: GCC_ANALYZER_WARNING (CWE-131):
avahi-0.8/avahi-core/socket.c: scope_hint: In function 'sendmsg_loop'
avahi-0.8/avahi-core/socket.c:458:38: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
avahi-0.8/avahi-core/socket.c:35: included_from: Included from here.
avahi-0.8/avahi-core/socket.c:25: included_from: Included from here.
# 456| if (errno != EAGAIN) {
# 457| char where[64];
# 458|-> struct sockaddr_storage *ss = msg->msg_name;
# 459|
# 460| if (ss->ss_family == PF_INET) {
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/socket.c:586: style[variableScope]: The scope of the variable 'cmsg' can be reduced.
# 584| struct msghdr msg;
# 585| struct iovec io;
# 586|-> struct cmsghdr *cmsg;
# 587| size_t cmsg_data[(CMSG_SPACE(sizeof(struct in6_pktinfo))/sizeof(size_t)) + 1];
# 588|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-core/socket.c:890: style[constVariablePointer]: Variable 'i' can be declared as pointer to const
# 888|
# 889| case IPV6_PKTINFO: {
# 890|-> struct in6_pktinfo *i = (struct in6_pktinfo*) CMSG_DATA(cmsg);
# 891|
# 892| if (ret_iface && i->ipi6_ifindex > 0)
Error: CPPCHECK_WARNING (CWE-570):
avahi-0.8/avahi-core/socket.c:938: style[knownConditionTrueFalse]: Condition 'ipv4_pktinfo(fd)<0' is always false
# 936| }
# 937|
# 938|-> if (ipv4_pktinfo(fd) < 0) {
# 939| goto fail;
# 940| }
Error: CPPCHECK_WARNING (CWE-570):
avahi-0.8/avahi-core/socket.c:984: style[knownConditionTrueFalse]: Condition 'ipv6_pktinfo(fd)<0' is always false
# 982| }
# 983|
# 984|-> if (ipv6_pktinfo(fd) < 0)
# 985| goto fail;
# 986|
Error: CPPCHECK_WARNING (CWE-475):
avahi-0.8/avahi-core/update-test.c:51: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
# 49| assert(group);
# 50|
# 51|-> ret = avahi_server_add_service(s, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "foo", "_http._tcp", NULL, NULL, 80, "test1", NULL);
# 52| assert(ret == AVAHI_OK);
# 53|
Error: CPPCHECK_WARNING (CWE-475):
avahi-0.8/avahi-core/update-test.c:64: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
# 62| avahi_log_debug("modifying");
# 63|
# 64|-> ret = avahi_server_update_service_txt(s, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "foo", "_http._tcp", NULL, "test2", NULL);
# 65| assert(ret == AVAHI_OK);
# 66| }
Error: CPPCHECK_WARNING (CWE-570):
avahi-0.8/avahi-core/util.c:76: style[unsignedLessThanZero]: Checking if unsigned expression 'size' is less than zero.
# 74| assert(mac);
# 75|
# 76|-> if (size <= 0) {
# 77| *r = 0;
# 78| return r;
Error: CPPCHECK_WARNING (CWE-570):
avahi-0.8/avahi-core/wide-area.c:147: style[unsignedLessThanZero]: Checking if unsigned expression 'e->n_dns_servers' is less than zero.
# 145| assert(s);
# 146|
# 147|-> if (e->n_dns_servers <= 0)
# 148| return -1;
# 149|
Error: CPPCHECK_WARNING (CWE-476):
avahi-0.8/avahi-core/wide-area.c:501: warning[nullPointerRedundantCheck]: Either the condition 'c=find_record_in_cache(e,r)' is redundant or there is possible null pointer dereference: c.
# 499| }
# 500|
# 501|-> c->record = avahi_record_ref(r);
# 502|
# 503| gettimeofday(&c->timestamp, NULL);
Error: CPPCHECK_WARNING (CWE-476):
avahi-0.8/avahi-core/wide-area.c:504: warning[nullPointerRedundantCheck]: Either the condition 'c=find_record_in_cache(e,r)' is redundant or there is possible null pointer dereference: c.
# 502|
# 503| gettimeofday(&c->timestamp, NULL);
# 504|-> c->expiry = c->timestamp;
# 505| avahi_timeval_add(&c->expiry, r->ttl * 1000000);
# 506|
Error: CPPCHECK_WARNING (CWE-476):
avahi-0.8/avahi-core/wide-area.c:507: warning[nullPointerRedundantCheck]: Either the condition 'c=find_record_in_cache(e,r)' is redundant or there is possible null pointer dereference: c.
# 505| avahi_timeval_add(&c->expiry, r->ttl * 1000000);
# 506|
# 507|-> if (c->time_event)
# 508| avahi_time_event_update(c->time_event, &c->expiry);
# 509| else
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-daemon/chroot.c:108: style[unusedStructMember]: union member 'Anonymous1::buf' is never used.
# 106| union {
# 107| struct cmsghdr hdr;
# 108|-> char buf[CMSG_SPACE(sizeof(int))];
# 109| } cmsg;
# 110|
Error: CPPCHECK_WARNING (CWE-571):
avahi-0.8/avahi-daemon/chroot.c:405: style[knownConditionTrueFalse]: Condition 'r<0' is always true
# 403| if ((r = read(helper_fd, &c, sizeof(c))) < 0 &&
# 404| (errno != EPIPE && errno != ECONNRESET)) {
# 405|-> avahi_log_error("read() failed: %s\n", r < 0 ? strerror(errno) : "EOF");
# 406| return -1;
# 407| }
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-daemon/dbus-util.c:349: style[unreadVariable]: Variable 'size' is assigned a value that is never used.
# 347|
# 348| *rdata = NULL;
# 349|-> size = 0;
# 350| return -1;
# 351| }
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-daemon/dbus-util.c:349: warning[uselessAssignmentPtrArg]: Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
# 347|
# 348| *rdata = NULL;
# 349|-> size = 0;
# 350| return -1;
# 351| }
Error: COMPILER_WARNING (CWE-252):
avahi-0.8/avahi-daemon/main.c: scope_hint: In function ‘run_server’
avahi-0.8/avahi-daemon/main.c:1219:9: warning[-Wunused-result]: ignoring return value of ‘chdir’ declared with attribute ‘warn_unused_result’
# 1219 | chdir("/");
# | ^~~~~~~~~~
# 1217|
# 1218| avahi_log_info("Successfully called chroot().");
# 1219|-> chdir("/");
# 1220|
# 1221| if (avahi_caps_drop_all() < 0) {
Error: COMPILER_WARNING (CWE-252):
avahi-0.8/avahi-daemon/main.c: scope_hint: In function ‘make_runtime_dir’
avahi-0.8/avahi-daemon/main.c:1445:5: warning[-Wunused-result]: ignoring return value of ‘chown’ declared with attribute ‘warn_unused_result’
# 1445 | chown(AVAHI_DAEMON_RUNTIME_DIR, pw->pw_uid, gr->gr_gid);
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1443| }
# 1444|
# 1445|-> chown(AVAHI_DAEMON_RUNTIME_DIR, pw->pw_uid, gr->gr_gid);
# 1446|
# 1447| if (stat(AVAHI_DAEMON_RUNTIME_DIR, &st) < 0) {
Error: COMPILER_WARNING (CWE-252):
avahi-0.8/avahi-daemon/main.c: scope_hint: In function ‘init_rand_seed’
avahi-0.8/avahi-daemon/main.c:1510:9: warning[-Wunused-result]: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’
# 1510 | read(fd, &seed, sizeof(seed));
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1508| * booted at the same time choose different random seeds. */
# 1509| if ((fd = open(RANDOM_DEVICE, O_RDONLY)) >= 0) {
# 1510|-> read(fd, &seed, sizeof(seed));
# 1511| close(fd);
# 1512| }
Error: COMPILER_WARNING (CWE-252):
avahi-0.8/avahi-daemon/main.c: scope_hint: In function ‘main’
avahi-0.8/avahi-daemon/main.c:1693:9: warning[-Wunused-result]: ignoring return value of ‘chdir’ declared with attribute ‘warn_unused_result’
# 1693 | chdir("/");
# | ^~~~~~~~~~
# 1691| enforce_rlimits();
# 1692|
# 1693|-> chdir("/");
# 1694|
# 1695| #ifdef ENABLE_CHROOT
Error: GCC_ANALYZER_WARNING (CWE-775):
avahi-0.8/avahi-daemon/simple-protocol.c: scope_hint: In function ‘simple_protocol_setup’
avahi-0.8/avahi-daemon/simple-protocol.c:524:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*server.fd’
avahi-0.8/avahi-common/malloc.h:28: included_from: Included from here.
avahi-0.8/avahi-daemon/simple-protocol.c:41: included_from: Included from here.
avahi-0.8/avahi-daemon/simple-protocol.c:466:14: note: in expansion of macro ‘avahi_new’
avahi-0.8/avahi-daemon/simple-protocol.c: scope_hint: In function ‘simple_protocol_setup’
# 522| server->remove_socket = 1;
# 523|
# 524|-> if (listen(server->fd, SOMAXCONN) < 0) {
# 525| avahi_log_warn("listen(): %s", strerror(errno));
# 526| goto fail;
Error: GCC_ANALYZER_WARNING (CWE-775):
avahi-0.8/avahi-daemon/simple-protocol.c:530:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*server.fd’
avahi-0.8/avahi-daemon/simple-protocol.c:466:14: note: in expansion of macro ‘avahi_new’
avahi-0.8/avahi-daemon/simple-protocol.c: scope_hint: In function ‘simple_protocol_setup’
# 528| }
# 529|
# 530|-> umask(u);
# 531|
# 532| server->watch = poll_api->watch_new(poll_api, server->fd, AVAHI_WATCH_IN, server_work, server);
Error: COMPILER_WARNING (CWE-704):
avahi-0.8/avahi-daemon/static-services.c: scope_hint: In function ‘replacestr’
avahi-0.8/avahi-daemon/static-services.c:88:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 86| char *r = NULL, *e, *n;
# 87|
# 88|-> while ((e = strstr(pattern, a))) {
# 89| char *k;
# 90|
Error: COMPILER_WARNING (CWE-704):
avahi-0.8/avahi-daemon/static-services.c: scope_hint: In function ‘xml_cdata’
avahi-0.8/avahi-daemon/static-services.c:747:30: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 745| assert(u->service);
# 746| if (u->txt_key == NULL) {
# 747|-> char *equals = memchr(s, '=', len);
# 748|
# 749| if (equals != NULL) {
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-discover-standalone/main.c:268: style[constParameterCallback]: Parameter 'r' can be declared as pointer to const. However it seems that 'service_resolver_callback' is a callback function, if 'r' is declared with const you might also need to cast function pointer(s).
# 266|
# 267| static void service_resolver_callback(
# 268|-> AvahiSServiceResolver *r,
# 269| AVAHI_GCC_UNUSED AvahiIfIndex interface,
# 270| AVAHI_GCC_UNUSED AvahiProtocol protocol,
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-discover-standalone/main.c:280: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'service_resolver_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
# 278| AvahiStringList *txt,
# 279| AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
# 280|-> void* userdata) {
# 281|
# 282| struct Service *s;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-discover-standalone/main.c:314: style[constParameterCallback]: Parameter 'event' can be declared as pointer to const. However it seems that 'main_window_on_delete_event' is a callback function, if 'event' is declared with const you might also need to cast function pointer(s).
# 312| }
# 313|
# 314|-> static gboolean main_window_on_delete_event(AVAHI_GCC_UNUSED GtkWidget *widget, AVAHI_GCC_UNUSED GdkEvent *event, AVAHI_GCC_UNUSED gpointer user_data) {
# 315| gtk_main_quit();
# 316| return FALSE;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-discover-standalone/main.c:314: style[constParameterCallback]: Parameter 'widget' can be declared as pointer to const. However it seems that 'main_window_on_delete_event' is a callback function, if 'widget' is declared with const you might also need to cast function pointer(s).
# 312| }
# 313|
# 314|-> static gboolean main_window_on_delete_event(AVAHI_GCC_UNUSED GtkWidget *widget, AVAHI_GCC_UNUSED GdkEvent *event, AVAHI_GCC_UNUSED gpointer user_data) {
# 315| gtk_main_quit();
# 316| return FALSE;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-dnsconfd/main.c:325: style[variableScope]: The scope of the variable 'i' can be reduced.
# 323| }
# 324| } else {
# 325|-> DNSServerInfo *i;
# 326|
# 327| if (port == 53)
Error: CPPCHECK_WARNING (CWE-571):
avahi-0.8/avahi-dnsconfd/main.c:459: style[knownConditionTrueFalse]: Condition '!quit' is always true
# 457| ret = 0;
# 458|
# 459|-> while (!quit) {
# 460| fd_set rfds, wfds;
# 461|
Error: COMPILER_WARNING (CWE-252):
avahi-0.8/avahi-dnsconfd/main.c: scope_hint: In function ‘main’
avahi-0.8/avahi-dnsconfd/main.c:618:9: warning[-Wunused-result]: ignoring return value of ‘chdir’ declared with attribute ‘warn_unused_result’
# 618 | chdir("/");
# | ^~~~~~~~~~
# 616| daemon_log_use = DAEMON_LOG_SYSLOG;
# 617|
# 618|-> chdir("/");
# 619|
# 620| if (daemon_pid_file_create() < 0) {
Error: CPPCHECK_WARNING (CWE-783):
avahi-0.8/avahi-glib/glib-watch.c:95: style[clarifyCalculation]: Clarify calculation precedence for '&' and '?'.
# 93| static gushort map_events_to_glib(AvahiWatchEvent events) {
# 94| return
# 95|-> (events & AVAHI_WATCH_IN ? G_IO_IN : 0) |
# 96| (events & AVAHI_WATCH_OUT ? G_IO_OUT : 0) |
# 97| (events & AVAHI_WATCH_ERR ? G_IO_ERR : 0) |
Error: CPPCHECK_WARNING (CWE-783):
avahi-0.8/avahi-glib/glib-watch.c:96: style[clarifyCalculation]: Clarify calculation precedence for '&' and '?'.
# 94| return
# 95| (events & AVAHI_WATCH_IN ? G_IO_IN : 0) |
# 96|-> (events & AVAHI_WATCH_OUT ? G_IO_OUT : 0) |
# 97| (events & AVAHI_WATCH_ERR ? G_IO_ERR : 0) |
# 98| (events & AVAHI_WATCH_HUP ? G_IO_HUP : 0);
Error: CPPCHECK_WARNING (CWE-783):
avahi-0.8/avahi-glib/glib-watch.c:97: style[clarifyCalculation]: Clarify calculation precedence for '&' and '?'.
# 95| (events & AVAHI_WATCH_IN ? G_IO_IN : 0) |
# 96| (events & AVAHI_WATCH_OUT ? G_IO_OUT : 0) |
# 97|-> (events & AVAHI_WATCH_ERR ? G_IO_ERR : 0) |
# 98| (events & AVAHI_WATCH_HUP ? G_IO_HUP : 0);
# 99| }
Error: CPPCHECK_WARNING (CWE-783):
avahi-0.8/avahi-glib/glib-watch.c:98: style[clarifyCalculation]: Clarify calculation precedence for '&' and '?'.
# 96| (events & AVAHI_WATCH_OUT ? G_IO_OUT : 0) |
# 97| (events & AVAHI_WATCH_ERR ? G_IO_ERR : 0) |
# 98|-> (events & AVAHI_WATCH_HUP ? G_IO_HUP : 0);
# 99| }
# 100|
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-glib/glib-watch.c: scope_hint: In function 'prepare_func'
avahi-0.8/avahi-glib/glib-watch.c:269:9: warning[-Wdeprecated-declarations]: 'GTimeVal' is deprecated: Use 'GDateTime' instead
/usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
avahi-0.8/avahi-glib/glib-watch.h:28: included_from: Included from here.
avahi-0.8/avahi-glib/glib-watch.c:28: included_from: Included from here.
/usr/include/glib-2.0/glib/gtypes.h:622:8: note: declared here
# 267|
# 268| if ((next_timeout = find_next_timeout(g))) {
# 269|-> GTimeVal now;
# 270| struct timeval tvnow;
# 271| AvahiUsec usec;
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-glib/glib-watch.c: scope_hint: In function ‘prepare_func’
avahi-0.8/avahi-glib/glib-watch.c:269:9: warning[-Wdeprecated-declarations]: ‘GTimeVal’ is deprecated: Use 'GDateTime' instead
/usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
avahi-0.8/avahi-glib/glib-watch.h:28: included_from: Included from here.
avahi-0.8/avahi-glib/glib-watch.c:28: included_from: Included from here.
/usr/include/glib-2.0/glib/gtypes.h:622:8: note: declared here
# 267|
# 268| if ((next_timeout = find_next_timeout(g))) {
# 269|-> GTimeVal now;
# 270| struct timeval tvnow;
# 271| AvahiUsec usec;
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-glib/glib-watch.c:273:9: warning[-Wdeprecated-declarations]: 'g_source_get_current_time' is deprecated: Use 'g_source_get_time' instead
/usr/include/glib-2.0/glib/giochannel.h:35: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
/usr/include/glib-2.0/glib/gmain.h:802:10: note: declared here
# 271| AvahiUsec usec;
# 272|
# 273|-> g_source_get_current_time(source, &now);
# 274| tvnow.tv_sec = now.tv_sec;
# 275| tvnow.tv_usec = now.tv_usec;
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-glib/glib-watch.c:273:9: warning[-Wdeprecated-declarations]: ‘g_source_get_current_time’ is deprecated: Use 'g_source_get_time' instead
/usr/include/glib-2.0/glib/giochannel.h:35: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
/usr/include/glib-2.0/glib/gmain.h:802:10: note: declared here
# 271| AvahiUsec usec;
# 272|
# 273|-> g_source_get_current_time(source, &now);
# 274| tvnow.tv_sec = now.tv_sec;
# 275| tvnow.tv_usec = now.tv_usec;
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-glib/glib-watch.c: scope_hint: In function 'check_func'
avahi-0.8/avahi-glib/glib-watch.c:299:9: warning[-Wdeprecated-declarations]: 'GTimeVal' is deprecated: Use 'GDateTime' instead
/usr/include/glib-2.0/glib/gtypes.h:622:8: note: declared here
# 297|
# 298| if ((next_timeout = find_next_timeout(g))) {
# 299|-> GTimeVal now;
# 300| struct timeval tvnow;
# 301| g_source_get_current_time(source, &now);
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-glib/glib-watch.c: scope_hint: In function ‘check_func’
avahi-0.8/avahi-glib/glib-watch.c:299:9: warning[-Wdeprecated-declarations]: ‘GTimeVal’ is deprecated: Use 'GDateTime' instead
/usr/include/glib-2.0/glib/gtypes.h:622:8: note: declared here
# 297|
# 298| if ((next_timeout = find_next_timeout(g))) {
# 299|-> GTimeVal now;
# 300| struct timeval tvnow;
# 301| g_source_get_current_time(source, &now);
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-glib/glib-watch.c:301:9: warning[-Wdeprecated-declarations]: 'g_source_get_current_time' is deprecated: Use 'g_source_get_time' instead
/usr/include/glib-2.0/glib/gmain.h:802:10: note: declared here
# 299| GTimeVal now;
# 300| struct timeval tvnow;
# 301|-> g_source_get_current_time(source, &now);
# 302| tvnow.tv_sec = now.tv_sec;
# 303| tvnow.tv_usec = now.tv_usec;
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-glib/glib-watch.c:301:9: warning[-Wdeprecated-declarations]: ‘g_source_get_current_time’ is deprecated: Use 'g_source_get_time' instead
/usr/include/glib-2.0/glib/gmain.h:802:10: note: declared here
# 299| GTimeVal now;
# 300| struct timeval tvnow;
# 301|-> g_source_get_current_time(source, &now);
# 302| tvnow.tv_sec = now.tv_sec;
# 303| tvnow.tv_usec = now.tv_usec;
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-glib/glib-watch.c: scope_hint: In function 'dispatch_func'
avahi-0.8/avahi-glib/glib-watch.c:324:9: warning[-Wdeprecated-declarations]: 'GTimeVal' is deprecated: Use 'GDateTime' instead
/usr/include/glib-2.0/glib/gtypes.h:622:8: note: declared here
# 322|
# 323| if ((next_timeout = find_next_timeout(g))) {
# 324|-> GTimeVal now;
# 325| struct timeval tvnow;
# 326| g_source_get_current_time(source, &now);
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-glib/glib-watch.c: scope_hint: In function ‘dispatch_func’
avahi-0.8/avahi-glib/glib-watch.c:324:9: warning[-Wdeprecated-declarations]: ‘GTimeVal’ is deprecated: Use 'GDateTime' instead
/usr/include/glib-2.0/glib/gtypes.h:622:8: note: declared here
# 322|
# 323| if ((next_timeout = find_next_timeout(g))) {
# 324|-> GTimeVal now;
# 325| struct timeval tvnow;
# 326| g_source_get_current_time(source, &now);
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-glib/glib-watch.c:326:9: warning[-Wdeprecated-declarations]: 'g_source_get_current_time' is deprecated: Use 'g_source_get_time' instead
/usr/include/glib-2.0/glib/gmain.h:802:10: note: declared here
# 324| GTimeVal now;
# 325| struct timeval tvnow;
# 326|-> g_source_get_current_time(source, &now);
# 327| tvnow.tv_sec = now.tv_sec;
# 328| tvnow.tv_usec = now.tv_usec;
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-glib/glib-watch.c:326:9: warning[-Wdeprecated-declarations]: ‘g_source_get_current_time’ is deprecated: Use 'g_source_get_time' instead
/usr/include/glib-2.0/glib/gmain.h:802:10: note: declared here
# 324| GTimeVal now;
# 325| struct timeval tvnow;
# 326|-> g_source_get_current_time(source, &now);
# 327| tvnow.tv_sec = now.tv_sec;
# 328| tvnow.tv_usec = now.tv_usec;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-client.c:89: style[constVariablePointer]: Variable '_glib__object' can be declared as pointer to const
# 87| break;
# 88| default:
# 89|-> G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
# 90| break;
# 91| }
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-client.c:98: style[constVariablePointer]: Variable 'priv' can be declared as pointer to const
# 96| GValue * value, GParamSpec * pspec) {
# 97| GaClient *client = GA_CLIENT(object);
# 98|-> GaClientPrivate *priv = GA_CLIENT_GET_PRIVATE(client);
# 99|
# 100| switch (property_id) {
Error: COMPILER_WARNING:
avahi-0.8/avahi-gobject/ga-client.c: scope_hint: In function 'ga_client_get_property'
avahi-0.8/avahi-gobject/ga-client.c:105:13: warning[-Wimplicit-fallthrough=]: this statement may fall through
# 105 | g_value_set_enum(value, priv->flags);
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
avahi-0.8/avahi-gobject/ga-client.c:106:9: note: here
# 106 | default:
# | ^~~~~~~
# 103| break;
# 104| case PROP_FLAGS:
# 105|-> g_value_set_enum(value, priv->flags);
# 106| default:
# 107| G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-client.c:107: style[constVariablePointer]: Variable '_glib__object' can be declared as pointer to const
# 105| g_value_set_enum(value, priv->flags);
# 106| default:
# 107|-> G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
# 108| break;
# 109| }
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-gobject/ga-client.c: scope_hint: In function 'ga_client_class_init'
avahi-0.8/avahi-gobject/ga-client.c:116:5: warning[-Wdeprecated-declarations]: 'g_type_class_add_private' is deprecated
/usr/include/glib-2.0/gobject/gobject.h:26: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:31: included_from: Included from here.
/usr/include/glib-2.0/gobject/gtype.h:1503:10: note: declared here
# 114| GParamSpec *param_spec;
# 115|
# 116|-> g_type_class_add_private(ga_client_class, sizeof (GaClientPrivate));
# 117|
# 118|
Error: COMPILER_WARNING (CWE-192):
avahi-0.8/avahi-gobject/ga-client.c:226:17: warning[-Wenum-conversion]: implicit conversion from 'AvahiClientState' to 'GaClientState'
# 226 | priv->state = state;
# | ^
# 224|
# 225| g_assert(c == self->avahi_client);
# 226|-> priv->state = state;
# 227| g_signal_emit(self, signals[STATE_CHANGED],
# 228| detail_for_state(state), state);
Error: COMPILER_WARNING (CWE-192):
avahi-0.8/avahi-gobject/ga-client.c:248:36: warning[-Wenum-conversion]: implicit conversion from 'GaClientFlags' to 'AvahiClientFlags'
# 248 | priv->flags,
# | ~~~~^~~~~~~
# 246|
# 247| aclient = avahi_client_new(avahi_glib_poll_get(priv->poll),
# 248|-> priv->flags,
# 249| _avahi_client_cb, client, &aerror);
# 250| if (aclient == NULL) {
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-entry-group.c:99: style[constVariablePointer]: Variable 'priv' can be declared as pointer to const
# 97| GValue * value, GParamSpec * pspec) {
# 98| GaEntryGroup *group = GA_ENTRY_GROUP(object);
# 99|-> GaEntryGroupPrivate *priv = GA_ENTRY_GROUP_GET_PRIVATE(group);
# 100|
# 101| switch (property_id) {
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-entry-group.c:106: style[constVariablePointer]: Variable '_glib__object' can be declared as pointer to const
# 104| break;
# 105| default:
# 106|-> G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
# 107| break;
# 108| }
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-gobject/ga-entry-group.c: scope_hint: In function 'ga_entry_group_class_init'
avahi-0.8/avahi-gobject/ga-entry-group.c:115:5: warning[-Wdeprecated-declarations]: 'g_type_class_add_private' is deprecated
/usr/include/glib-2.0/gobject/gobject.h:26: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:31: included_from: Included from here.
/usr/include/glib-2.0/gobject/gtype.h:1503:10: note: declared here
# 113| GParamSpec *param_spec;
# 114|
# 115|-> g_type_class_add_private(ga_entry_group_class,
# 116| sizeof (GaEntryGroupPrivate));
# 117|
Error: COMPILER_WARNING (CWE-192):
avahi-0.8/avahi-gobject/ga-entry-group.c:222:17: warning[-Wenum-conversion]: implicit conversion from 'AvahiEntryGroupState' to 'GaEntryGroupState'
# 222 | priv->state = state;
# | ^
# 220|
# 221| g_assert(g == priv->group);
# 222|-> priv->state = state;
# 223| g_signal_emit(self, signals[STATE_CHANGED],
# 224| detail_for_state(state), state);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-entry-group.c:324: style[constVariablePointer]: Variable 'kentry' can be declared as pointer to const
# 322| static void _hash_to_string_list_foreach(gpointer key, gpointer value, gpointer data) {
# 323| AvahiStringList **list = (AvahiStringList **) data;
# 324|-> GaEntryGroupServiceEntry *kentry = (GaEntryGroupServiceEntry *) key;
# 325| GaEntryGroupServiceEntry *ventry = (GaEntryGroupServiceEntry *) value;
# 326|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-entry-group.c:325: style[constVariablePointer]: Variable 'ventry' can be declared as pointer to const
# 323| AvahiStringList **list = (AvahiStringList **) data;
# 324| GaEntryGroupServiceEntry *kentry = (GaEntryGroupServiceEntry *) key;
# 325|-> GaEntryGroupServiceEntry *ventry = (GaEntryGroupServiceEntry *) value;
# 326|
# 327| if (value != NULL) {
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-record-browser.c:74: style[constParameterCallback]: Parameter 'obj' can be declared as pointer to const. However it seems that 'ga_record_browser_init' is a callback function, if 'obj' is declared with const you might also need to cast function pointer(s).
# 72| #define GA_RECORD_BROWSER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GA_TYPE_RECORD_BROWSER, GaRecordBrowserPrivate))
# 73|
# 74|-> static void ga_record_browser_init(AVAHI_GCC_UNUSED GaRecordBrowser * obj) {
# 75| /* allocate any data required by the object here */
# 76| }
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-record-browser.c:109: style[constVariablePointer]: Variable '_glib__object' can be declared as pointer to const
# 107| break;
# 108| default:
# 109|-> G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
# 110| break;
# 111| }
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-record-browser.c:118: style[constVariablePointer]: Variable 'priv' can be declared as pointer to const
# 116| GValue * value, GParamSpec * pspec) {
# 117| GaRecordBrowser *browser = GA_RECORD_BROWSER(object);
# 118|-> GaRecordBrowserPrivate *priv = GA_RECORD_BROWSER_GET_PRIVATE(browser);
# 119|
# 120| switch (property_id) {
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-record-browser.c:140: style[constVariablePointer]: Variable '_glib__object' can be declared as pointer to const
# 138| break;
# 139| default:
# 140|-> G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
# 141| break;
# 142| }
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-gobject/ga-record-browser.c: scope_hint: In function 'ga_record_browser_class_init'
avahi-0.8/avahi-gobject/ga-record-browser.c:150:5: warning[-Wdeprecated-declarations]: 'g_type_class_add_private' is deprecated
/usr/include/glib-2.0/gobject/gobject.h:26: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:31: included_from: Included from here.
/usr/include/glib-2.0/gobject/gtype.h:1503:10: note: declared here
# 148| GParamSpec *param_spec;
# 149|
# 150|-> g_type_class_add_private(ga_record_browser_class,
# 151| sizeof (GaRecordBrowserPrivate));
# 152|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-service-browser.c:113: style[constVariablePointer]: Variable '_glib__object' can be declared as pointer to const
# 111| break;
# 112| default:
# 113|-> G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
# 114| break;
# 115| }
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-service-browser.c:122: style[constVariablePointer]: Variable 'priv' can be declared as pointer to const
# 120| GValue * value, GParamSpec * pspec) {
# 121| GaServiceBrowser *browser = GA_SERVICE_BROWSER(object);
# 122|-> GaServiceBrowserPrivate *priv = GA_SERVICE_BROWSER_GET_PRIVATE(browser);
# 123|
# 124| switch (property_id) {
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-service-browser.c:141: style[constVariablePointer]: Variable '_glib__object' can be declared as pointer to const
# 139| break;
# 140| default:
# 141|-> G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
# 142| break;
# 143| }
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-gobject/ga-service-browser.c: scope_hint: In function 'ga_service_browser_class_init'
avahi-0.8/avahi-gobject/ga-service-browser.c:152:5: warning[-Wdeprecated-declarations]: 'g_type_class_add_private' is deprecated
/usr/include/glib-2.0/gobject/gobject.h:26: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:31: included_from: Included from here.
/usr/include/glib-2.0/gobject/gtype.h:1503:10: note: declared here
# 150| GParamSpec *param_spec;
# 151|
# 152|-> g_type_class_add_private(ga_service_browser_class,
# 153| sizeof (GaServiceBrowserPrivate));
# 154|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-service-resolver.c:125: style[constVariablePointer]: Variable '_glib__object' can be declared as pointer to const
# 123| break;
# 124| default:
# 125|-> G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
# 126| break;
# 127| }
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-service-resolver.c:134: style[constVariablePointer]: Variable 'priv' can be declared as pointer to const
# 132| GValue * value, GParamSpec * pspec) {
# 133| GaServiceResolver *resolver = GA_SERVICE_RESOLVER(object);
# 134|-> GaServiceResolverPrivate *priv =
# 135| GA_SERVICE_RESOLVER_GET_PRIVATE(resolver);
# 136|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-service-resolver.c:160: style[constVariablePointer]: Variable '_glib__object' can be declared as pointer to const
# 158| break;
# 159| default:
# 160|-> G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
# 161| break;
# 162| }
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-gobject/ga-service-resolver.c: scope_hint: In function 'ga_service_resolver_class_init'
avahi-0.8/avahi-gobject/ga-service-resolver.c:171:5: warning[-Wdeprecated-declarations]: 'g_type_class_add_private' is deprecated
# 171 | g_type_class_add_private(ga_service_resolver_class,
# | ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/gobject/gobject.h:26: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:31: included_from: Included from here.
/usr/include/glib-2.0/gobject/gtype.h:1503:10: note: declared here
# 1503 | void g_type_class_add_private (gpointer g_class,
# | ^~~~~~~~~~~~~~~~~~~~~~~~
# 169| GParamSpec *param_spec;
# 170|
# 171|-> g_type_class_add_private(ga_service_resolver_class,
# 172| sizeof (GaServiceResolverPrivate));
# 173|
Error: CPPCHECK_WARNING (CWE-476):
avahi-0.8/avahi-gobject/ga-service-resolver.c:369: warning[nullPointerRedundantCheck]: Either the condition 'client!=((void*)0)' is redundant or there is possible null pointer dereference: client.
# 367| priv->client = client;
# 368|
# 369|-> priv->resolver = avahi_service_resolver_new(client->avahi_client,
# 370| priv->interface,
# 371| priv->protocol,
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-gobject/ga-service-resolver.c:393: style[constVariablePointer]: Variable 'priv' can be declared as pointer to const
# 391| gboolean ga_service_resolver_get_address(GaServiceResolver * resolver,
# 392| AvahiAddress * address, uint16_t * port) {
# 393|-> GaServiceResolverPrivate *priv =
# 394| GA_SERVICE_RESOLVER_GET_PRIVATE(resolver);
# 395| if (priv->port == 0) {
Error: COMPILER_WARNING:
avahi-0.8/avahi-gobject/signals-marshal.c: scope_hint: In function '_ga_signals_marshal_VOID__INT_ENUM_STRING_STRING_STRING_STRING_POINTER_INT_POINTER_INT'
avahi-0.8/avahi-gobject/signals-marshal.c:88:14: warning[-Wpedantic]: ISO C forbids conversion of object pointer to function pointer type
# 88 | callback = (GMarshalFunc_VOID__INT_ENUM_STRING_STRING_STRING_STRING_POINTER_INT_POINTER_INT) (marshal_data ? marshal_data : cc->callback);
# | ^
# 86| data2 = closure->data;
# 87| }
# 88|-> callback = (GMarshalFunc_VOID__INT_ENUM_STRING_STRING_STRING_STRING_POINTER_INT_POINTER_INT) (marshal_data ? marshal_data : cc->callback);
# 89|
# 90| callback (data1,
Error: COMPILER_WARNING:
avahi-0.8/avahi-gobject/signals-marshal.c: scope_hint: In function '_ga_signals_marshal_VOID__INT_ENUM_STRING_STRING_STRING_UINT'
avahi-0.8/avahi-gobject/signals-marshal.c:137:14: warning[-Wpedantic]: ISO C forbids conversion of object pointer to function pointer type
# 137 | callback = (GMarshalFunc_VOID__INT_ENUM_STRING_STRING_STRING_UINT) (marshal_data ? marshal_data : cc->callback);
# | ^
# 135| data2 = closure->data;
# 136| }
# 137|-> callback = (GMarshalFunc_VOID__INT_ENUM_STRING_STRING_STRING_UINT) (marshal_data ? marshal_data : cc->callback);
# 138|
# 139| callback (data1,
Error: COMPILER_WARNING:
avahi-0.8/avahi-gobject/signals-marshal.c: scope_hint: In function '_ga_signals_marshal_VOID__INT_ENUM_STRING_UINT_UINT_POINTER_INT_INT'
avahi-0.8/avahi-gobject/signals-marshal.c:184:14: warning[-Wpedantic]: ISO C forbids conversion of object pointer to function pointer type
# 184 | callback = (GMarshalFunc_VOID__INT_ENUM_STRING_UINT_UINT_POINTER_INT_INT) (marshal_data ? marshal_data : cc->callback);
# | ^
# 182| data2 = closure->data;
# 183| }
# 184|-> callback = (GMarshalFunc_VOID__INT_ENUM_STRING_UINT_UINT_POINTER_INT_INT) (marshal_data ? marshal_data : cc->callback);
# 185|
# 186| callback (data1,
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-ui/avahi-ui.c: scope_hint: In function 'get_default_response'
avahi-0.8/avahi-ui/avahi-ui.c:140:9: warning[-Wdeprecated-declarations]: 'gtk_dialog_get_action_area' is deprecated
/usr/include/gtk-3.0/gtk/gtkaboutdialog.h:30: included_from: Included from here.
/usr/include/gtk-3.0/gtk/gtk.h:31: included_from: Included from here.
avahi-0.8/avahi-ui/avahi-ui.c:30: included_from: Included from here.
/usr/include/gtk-3.0/gtk/gtkdialog.h:203:13: note: declared here
# 138| gint bad = GTK_RESPONSE_NONE;
# 139|
# 140|-> t = children = gtk_container_get_children(GTK_CONTAINER(gtk_dialog_get_action_area(dlg)));
# 141|
# 142| while (t) {
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-ui/avahi-ui.c:346: style[constParameterCallback]: Parameter 'txt' can be declared as pointer to const. However it seems that 'resolve_callback' is a callback function, if 'txt' is declared with const you might also need to cast function pointer(s).
# 344| const AvahiAddress *a,
# 345| uint16_t port,
# 346|-> AvahiStringList *txt,
# 347| AvahiLookupResultFlags flags G_GNUC_UNUSED,
# 348| void *userdata) {
Error: COMPILER_WARNING:
avahi-0.8/avahi-ui/avahi-ui.c: scope_hint: In function 'browse_callback'
avahi-0.8/avahi-ui/avahi-ui.c:522:13: warning[-Wimplicit-fallthrough=]: this statement may fall through
# 522 | gtk_widget_destroy(m);
# | ^~~~~~~~~~~~~~~~~~~~~
avahi-0.8/avahi-ui/avahi-ui.c:527:9: note: here
# 527 | case AVAHI_BROWSER_ALL_FOR_NOW:
# | ^~~~
# 520| avahi_strerror(avahi_client_errno(d->priv->client)));
# 521| gtk_dialog_run(GTK_DIALOG(m));
# 522|-> gtk_widget_destroy(m);
# 523|
# 524| /* Fall through */
Error: COMPILER_WARNING:
avahi-0.8/avahi-ui/avahi-ui.c: scope_hint: In function 'domain_browse_callback'
avahi-0.8/avahi-ui/avahi-ui.c:652:13: warning[-Wimplicit-fallthrough=]: this statement may fall through
# 652 | gtk_widget_destroy(m);
# | ^~~~~~~~~~~~~~~~~~~~~
avahi-0.8/avahi-ui/avahi-ui.c:657:9: note: here
# 657 | case AVAHI_BROWSER_ALL_FOR_NOW:
# | ^~~~
# 650| avahi_strerror(avahi_client_errno(d->priv->client)));
# 651| gtk_dialog_run(GTK_DIALOG(m));
# 652|-> gtk_widget_destroy(m);
# 653|
# 654| /* Fall through */
Error: CPPCHECK_WARNING (CWE-570):
avahi-0.8/avahi-ui/avahi-ui.c:758: style[unsignedLessThanZero]: Checking if unsigned expression 'd->priv->service_pulse_timeout' is less than zero.
# 756| gtk_widget_show(d->priv->service_progress_bar);
# 757|
# 758|-> if (d->priv->service_pulse_timeout <= 0)
# 759| d->priv->service_pulse_timeout = g_timeout_add(100, service_pulse_callback, d);
# 760|
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-ui/avahi-ui.c: scope_hint: In function 'response_callback'
avahi-0.8/avahi-ui/avahi-ui.c:891:9: warning[-Wdeprecated-declarations]: 'gdk_cursor_new' is deprecated: Use 'gdk_cursor_new_for_display' instead
/usr/include/gtk-3.0/gdk/gdk.h:34: included_from: Included from here.
/usr/include/gtk-3.0/gtk/gtk.h:30: included_from: Included from here.
/usr/include/gtk-3.0/gdk/gdkcursor.h:228:12: note: declared here
# 889|
# 890| gtk_widget_set_sensitive(GTK_WIDGET(dialog), FALSE);
# 891|-> cursor = gdk_cursor_new(GDK_WATCH);
# 892| gdk_window_set_cursor(gtk_widget_get_window(GTK_WIDGET(dialog)), cursor);
# 893| #if GTK_CHECK_VERSION(3,0,0)
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-ui/avahi-ui.c: scope_hint: In function 'aui_service_dialog_init'
avahi-0.8/avahi-ui/avahi-ui.c:1136:5: warning[-Wdeprecated-declarations]: 'gtk_misc_set_alignment' is deprecated
/usr/include/gtk-3.0/gtk/gtklabel.h:32: included_from: Included from here.
/usr/include/gtk-3.0/gtk/gtkaccellabel.h:35: included_from: Included from here.
/usr/include/gtk-3.0/gtk/gtk.h:33: included_from: Included from here.
/usr/include/gtk-3.0/gtk/deprecated/gtkmisc.h:72:9: note: declared here
# 1134| p->domain_label = gtk_label_new(_("Initializing..."));
# 1135| gtk_label_set_ellipsize(GTK_LABEL(p->domain_label), TRUE);
# 1136|-> gtk_misc_set_alignment(GTK_MISC(p->domain_label), 0, 0.5);
# 1137| gtk_box_pack_start(GTK_BOX(vbox), p->domain_label, FALSE, FALSE, 0);
# 1138|
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-ui/avahi-ui.c:1187:5: warning[-Wdeprecated-declarations]: 'gtk_dialog_get_action_area' is deprecated
/usr/include/gtk-3.0/gtk/gtkdialog.h:203:13: note: declared here
# 1185| gtk_button_set_image(GTK_BUTTON(p->domain_button), gtk_image_new_from_icon_name("network-workgroup", GTK_ICON_SIZE_BUTTON));
# 1186| g_signal_connect(p->domain_button, "clicked", G_CALLBACK(domain_button_clicked), d);
# 1187|-> gtk_box_pack_start(GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(d))), p->domain_button, FALSE, TRUE, 0);
# 1188| gtk_button_box_set_child_secondary(GTK_BUTTON_BOX(gtk_dialog_get_action_area(GTK_DIALOG(d))), p->domain_button, TRUE);
# 1189| gtk_widget_show(p->domain_button);
Error: COMPILER_WARNING (CWE-477):
avahi-0.8/avahi-ui/avahi-ui.c:1188:5: warning[-Wdeprecated-declarations]: 'gtk_dialog_get_action_area' is deprecated
/usr/include/gtk-3.0/gtk/gtkdialog.h:203:13: note: declared here
# 1186| g_signal_connect(p->domain_button, "clicked", G_CALLBACK(domain_button_clicked), d);
# 1187| gtk_box_pack_start(GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(d))), p->domain_button, FALSE, TRUE, 0);
# 1188|-> gtk_button_box_set_child_secondary(GTK_BUTTON_BOX(gtk_dialog_get_action_area(GTK_DIALOG(d))), p->domain_button, TRUE);
# 1189| gtk_widget_show(p->domain_button);
# 1190|
Error: CPPCHECK_WARNING (CWE-570):
avahi-0.8/avahi-ui/avahi-ui.c:1210: style[unsignedLessThanZero]: Checking if unsigned expression 'd->priv->start_idle' is less than zero.
# 1208| g_return_if_fail(AUI_IS_SERVICE_DIALOG(d));
# 1209|
# 1210|-> if (d->priv->start_idle <= 0)
# 1211| d->priv->start_idle = g_idle_add(start_callback, d);
# 1212| }
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-ui/avahi-ui.c:1436: style[constVariablePointer]: Variable '_glib__object' can be declared as pointer to const
# 1434|
# 1435| default:
# 1436|-> G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
# 1437| break;
# 1438| }
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-ui/avahi-ui.c:1490: style[constVariablePointer]: Variable '_glib__object' can be declared as pointer to const
# 1488|
# 1489| default:
# 1490|-> G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
# 1491| break;
# 1492| }
Error: CPPCHECK_WARNING (CWE-686):
avahi-0.8/avahi-ui/bssh.c:189: warning[invalidPrintfArgType_uint]: %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'.
# 187| if (avahi_domain_equal(t, "_rfb._tcp")) {
# 188| char p[AVAHI_DOMAIN_NAME_MAX+16];
# 189|-> snprintf(p, sizeof(p), "%s:%u", h, aui_service_dialog_get_port(AUI_SERVICE_DIALOG(d))-5900);
# 190|
# 191| gtk_widget_destroy(d);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-utils/avahi-browse.c:98: style[constParameterPointer]: Parameter 'c' can be declared as pointer to const
# 96| static int browsing = 0;
# 97|
# 98|-> static void check_terminate(Config *c) {
# 99|
# 100| assert(n_all_for_now >= 0);
Error: CPPCHECK_WARNING (CWE-457):
avahi-0.8/avahi-utils/avahi-browse.c:151: warning[uninitvar]: Uninitialized variable: to
# 149| *t = 0;
# 150|
# 151|-> return to;
# 152| }
# 153|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-utils/avahi-browse.c:154: style[constParameterPointer]: Parameter 'config' can be declared as pointer to const
# 152| }
# 153|
# 154|-> static void print_service_line(Config *config, char c, AvahiIfIndex interface, AvahiProtocol protocol, const char *name, const char *type, const char *domain, int nl) {
# 155| char ifname[IF_NAMESIZE];
# 156|
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-utils/avahi-browse.c:357: style[constVariablePointer]: Variable 'b' can be declared as pointer to const
# 355|
# 356| static void browse_service_type(Config *c, const char *stype, const char *domain) {
# 357|-> AvahiServiceBrowser *b;
# 358| AvahiStringList *i;
# 359|
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-utils/avahi-browse.c:368: style[unreadVariable]: Variable 'b' is assigned a value that is never used.
# 366| return;
# 367|
# 368|-> if (!(b = avahi_service_browser_new(
# 369| client,
# 370| AVAHI_IF_UNSPEC,
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-utils/avahi-browse.c:431: style[constVariablePointer]: Variable 'b' can be declared as pointer to const
# 429|
# 430| static void browse_all(Config *c) {
# 431|-> AvahiServiceTypeBrowser *b;
# 432|
# 433| assert(c);
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-utils/avahi-browse.c:435: style[unreadVariable]: Variable 'b' is assigned a value that is never used.
# 433| assert(c);
# 434|
# 435|-> if (!(b = avahi_service_type_browser_new(
# 436| client,
# 437| AVAHI_IF_UNSPEC,
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-utils/avahi-browse.c:505: style[constVariablePointer]: Variable 'b' can be declared as pointer to const
# 503|
# 504| static void browse_domains(Config *c) {
# 505|-> AvahiDomainBrowser *b;
# 506|
# 507| assert(c);
Error: CPPCHECK_WARNING (CWE-563):
avahi-0.8/avahi-utils/avahi-browse.c:509: style[unreadVariable]: Variable 'b' is assigned a value that is never used.
# 507| assert(c);
# 508|
# 509|-> if (!(b = avahi_domain_browser_new(
# 510| client,
# 511| AVAHI_IF_UNSPEC,
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-utils/avahi-browse.c:786: style[constVariablePointer]: Variable 'ec' can be declared as pointer to const
# 784| Config config;
# 785| const char *argv0;
# 786|-> char *ec;
# 787|
# 788| avahi_init_i18n();
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/avahi-utils/avahi-browse.c:839: style[constVariablePointer]: Variable 't' can be declared as pointer to const
# 837| #if defined(HAVE_GDBM)
# 838| case COMMAND_DUMP_STDB: {
# 839|-> char *t;
# 840| stdb_setent();
# 841|
Error: COMPILER_WARNING (CWE-252):
avahi-0.8/avahi-utils/sigint.c: scope_hint: In function ‘handler’
avahi-0.8/avahi-utils/sigint.c:55:5: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
# 55 | write(pipe_fds[1], &s, sizeof(s));
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 53|
# 54| static void handler(int s) {
# 55|-> write(pipe_fds[1], &s, sizeof(s));
# 56| }
# 57|
Error: CPPCHECK_WARNING (CWE-475):
avahi-0.8/examples/client-publish-service.c:115: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
# 113|
# 114| /* Add the service for IPP */
# 115|-> if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_ipp._tcp", NULL, NULL, 651, "test=blah", r, NULL)) < 0) {
# 116|
# 117| if (ret == AVAHI_ERR_COLLISION)
Error: CPPCHECK_WARNING (CWE-475):
avahi-0.8/examples/client-publish-service.c:125: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
# 123|
# 124| /* Add the same service for BSD LPR */
# 125|-> if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_printer._tcp", NULL, NULL, 515, NULL)) < 0) {
# 126|
# 127| if (ret == AVAHI_ERR_COLLISION)
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/examples/core-publish-service.c:42: style[constParameterCallback]: Parameter 'g' can be declared as pointer to const. However it seems that 'entry_group_callback' is a callback function, if 'g' is declared with const you might also need to cast function pointer(s).
# 40| static void create_services(AvahiServer *s);
# 41|
# 42|-> static void entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiEntryGroupState state, AVAHI_GCC_UNUSED void *userdata) {
# 43| assert(s);
# 44| assert(g == group);
Error: CPPCHECK_WARNING (CWE-475):
avahi-0.8/examples/core-publish-service.c:103: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
# 101|
# 102| /* Add the service for IPP */
# 103|-> if ((ret = avahi_server_add_service(s, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_ipp._tcp", NULL, NULL, 651, "test=blah", r, NULL)) < 0) {
# 104| fprintf(stderr, "Failed to add _ipp._tcp service: %s\n", avahi_strerror(ret));
# 105| goto fail;
Error: CPPCHECK_WARNING (CWE-475):
avahi-0.8/examples/core-publish-service.c:109: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
# 107|
# 108| /* Add the same service for BSD LPR */
# 109|-> if ((ret = avahi_server_add_service(s, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_printer._tcp", NULL, NULL, 515, NULL)) < 0) {
# 110| fprintf(stderr, "Failed to add _printer._tcp service: %s\n", avahi_strerror(ret));
# 111| goto fail;
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/examples/glib-integration.c:57: style[variableScope]: The scope of the variable 'loop' can be reduced.
# 55| avahi_client_callback (AVAHI_GCC_UNUSED AvahiClient *client, AvahiClientState state, void *userdata)
# 56| {
# 57|-> GMainLoop *loop = userdata;
# 58|
# 59| g_message ("Avahi Client State Change: %d", state);
Error: CPPCHECK_WARNING (CWE-398):
avahi-0.8/tests/c-plus-plus-test.cc:79: style[constParameter]: Parameter 'argv' can be declared as const array
# 77| #include <avahi-glib/glib-watch.h>
# 78|
# 79|-> int main(int argc, char*argv[]) {
# 80| return 0;
# 81| }