# dnsconfd-1.7.2-1

## List of Findings

    Error: SHELLCHECK_WARNING (CWE-457): [#def1]
    /usr/lib/dracut/modules.d/99dnsconfd/module-setup.sh:16:18: warning[SC2154]: moddir is referenced but not assigned.
    #   14|   install() {
    #   15|       inst_simple /usr/lib/systemd/system/micro-dnsconfd.service
    #   16|->     inst_simple "$moddir/unbound_non_empty.conf" /etc/systemd/system/unbound.service.d/unbound_non_empty.conf
    #   17|       inst_simple "$moddir/micro_dnsconfd_no_fail.conf" /etc/systemd/system/micro-dnsconfd.service.d/micro_dnsconfd_no_fail.conf
    #   18|       inst_simple /usr/lib/sysusers.d/dnsconfd.conf

    Error: SHELLCHECK_WARNING (CWE-457): [#def2]
    /usr/lib/dracut/modules.d/99dnsconfd/module-setup.sh:25:27: warning[SC2154]: initdir is referenced but not assigned.
    #   23|       inst_multiple -o /etc/pki/dns/extracted/pem/*
    #   24|
    #   25|->     $SYSTEMCTL -q --root "$initdir" enable micro-dnsconfd.service
    #   26|   }

    Error: CPPCHECK_WARNING (CWE-476): [#def3]
    dnsconfd-1.7.2-build/dnsconfd-1.7.2/micro-dnsconfd/tests/test-nm-config-parsing.c:54: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: devnull
    #   52|       g_string_free(resolvconf_content, 1);
    #   53|     }
    #   54|->   fclose(devnull);
    #   55|   }
    #   56|   END_TEST

    Error: GCC_ANALYZER_WARNING (CWE-688): [#def4]
    dnsconfd-1.7.2-build/dnsconfd-1.7.2/micro-dnsconfd/tests/test-nm-config-parsing.c: scope_hint: In function ‘test_get_resolv_conf_string_fn’
    dnsconfd-1.7.2-build/dnsconfd-1.7.2/micro-dnsconfd/tests/test-nm-config-parsing.c:54:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen("/dev/null", "w")’ where non-null expected
    dnsconfd-1.7.2-build/dnsconfd-1.7.2/micro-dnsconfd/tests/test-nm-config-parsing.c:4: included_from: Included from here.
    /usr/include/stdio.h:184:12: note: argument 1 of ‘fclose’ must be non-null
    #   52|       g_string_free(resolvconf_content, 1);
    #   53|     }
    #   54|->   fclose(devnull);
    #   55|   }
    #   56|   END_TEST

    Error: CPPCHECK_WARNING (CWE-476): [#def5]
    dnsconfd-1.7.2-build/dnsconfd-1.7.2/micro-dnsconfd/tests/test-nm-config-parsing.c:156: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: devnull
    #  154|       g_variant_dict_unref(domain_dict);
    #  155|     }
    #  156|->   fclose(devnull);
    #  157|   }
    #  158|   END_TEST

    Error: GCC_ANALYZER_WARNING (CWE-688): [#def6]
    dnsconfd-1.7.2-build/dnsconfd-1.7.2/micro-dnsconfd/tests/test-uri-parsing.c: scope_hint: In function ‘test_parsing_fn’
    dnsconfd-1.7.2-build/dnsconfd-1.7.2/micro-dnsconfd/tests/test-uri-parsing.c:57:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen("/dev/null", "w")’ where non-null expected
    /usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
    /usr/include/glib-2.0/glib.h:56: included_from: Included from here.
    /usr/include/glib-2.0/gobject/gbinding.h:30: included_from: Included from here.
    /usr/include/glib-2.0/glib-object.h:24: included_from: Included from here.
    /usr/include/glib-2.0/gio/gioenums.h:30: included_from: Included from here.
    /usr/include/glib-2.0/gio/giotypes.h:30: included_from: Included from here.
    /usr/include/glib-2.0/gio/gio.h:28: included_from: Included from here.
    dnsconfd-1.7.2-build/dnsconfd-1.7.2/micro-dnsconfd/uri-parsing.h:1: included_from: Included from here.
    dnsconfd-1.7.2-build/dnsconfd-1.7.2/micro-dnsconfd/tests/test-uri-parsing.c:6: included_from: Included from here.
    dnsconfd-1.7.2-build/dnsconfd-1.7.2/micro-dnsconfd/tests/test-uri-parsing.c:4: included_from: Included from here.
    /usr/include/stdio.h:184:12: note: argument 1 of ‘fclose’ must be non-null
    #   55|     }
    #   56|     g_string_free(config_string, 1);
    #   57|->   fclose(dev_null);
    #   58|   }
    #   59|   END_TEST

## Scan Properties

analyzer-version-clippy | 1.85.0
analyzer-version-cppcheck | 2.17 dev
analyzer-version-gcc | 15.0.1
analyzer-version-gcc-analyzer | 15.0.1
analyzer-version-shellcheck | 0.10.0
analyzer-version-unicontrol | 0.0.2
enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol
exit-code | 0
host | ip-172-16-1-142.us-west-2.compute.internal
mock-config | fedora-rawhide-x86_64
project-name | dnsconfd-1.7.2-1
store-results-to | /tmp/tmpp519fzgb/dnsconfd-1.7.2-1.tar.xz
time-created | 2025-03-06 12:28:04
time-finished | 2025-03-06 12:29:59
tool | csmock
tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,unicontrol,clippy,gcc,cppcheck' '-o' '/tmp/tmpp519fzgb/dnsconfd-1.7.2-1.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpp519fzgb/dnsconfd-1.7.2-1.src.rpm'
tool-version | csmock-3.8.0-1.el9