Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass test suite with sanitizers #165

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Sep 22, 2022

  1. Avoid calling memcpy with NULL pointer and length 0

    Found by running the test suite with undefined behavior sanitizer:
    
        confuse.c:674:18: runtime error: null pointer passed as argument 2, which is declared to never be null
        /usr/include/string.h:44:28: note: nonnull attribute specified here
            #0 0x55f77032e601 in cfg_dupopt_array ./libconfuse/src/confuse.c:674:2
            libconfuse#1 0x55f770328227 in cfg_setopt ./libconfuse/src/confuse.c:1063:25
            libconfuse#2 0x55f77032f537 in cfg_init_defaults ./libconfuse/src/confuse.c:861:4
            libconfuse#3 0x55f770335dbb in cfg_init ./libconfuse/src/confuse.c:1877:2
            libconfuse#4 0x55f770321ff7 in main ./libconfuse/tests/keyval.c:50:8
            libconfuse#5 0x7f4bba429209 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
            libconfuse#6 0x7f4bba4292bb in __libc_start_main csu/../csu/libc-start.c:389:3
            libconfuse#7 0x55f7702623c0 in _start (./libconfuse/tests/keyval+0x3a3c0)
    cgzones committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    3e9488c View commit details
    Browse the repository at this point in the history
  2. Avoid implicit integer conversions

        confuse.c:601:30: runtime error: implicit conversion from type 'long' of value -1 (64-bit, signed) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned)
            #0 0x55bb8fcd6f30 in cfg_getsec ./libconfuse/src/confuse.c:601:30
            libconfuse#1 0x55bb8fcd23e4 in main ./libconfuse/tests/section_getopt.c:92:2
            libconfuse#2 0x7f380da29209 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
            libconfuse#3 0x7f380da292bb in __libc_start_main csu/../csu/libc-start.c:389:3
            libconfuse#4 0x55bb8fc123b0 in _start (./libconfuse/tests/section_getopt+0x3b3b0)
    cgzones committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    eb1e1e7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cff5e1d View commit details
    Browse the repository at this point in the history
  4. tests: skip test with broken fmemopen under sanitizers

    fmemopen(2) is broken with address and memory sanitizer, see
    google/sanitizers#628.
    cgzones committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    6af491b View commit details
    Browse the repository at this point in the history