Skip to content

demod_afsk.c:1125:34: runtime error: signed integer overflow: 2097758988 + 116542166 cannot be represented in type 'int' #107

@geeknik

Description

@geeknik

During testing with UBSan/ASan, undefined behavior in demod_afsk.c became apparent.

./atest -B 300 test000.wav

Data rate set to 300 bits / second.
11025 samples per second.  8 bits per sample.  1 audio channels.
37478 audio bytes in file.  Duration = 3.4 seconds.
Fix Bits level = 0
Channel 0: 300 baud, AFSK 1600 & 1800 Hz, D, 11025 sample rate.
demod_afsk.c:1125:34: runtime error: signed integer overflow: 2103657444 + 116869858 cannot be represented in type 'int'
    #0 0x50ab1a in nudge_pll /root/direwolf/demod_afsk.c:1125:34
    #1 0x5237fd in multi_modem_process_sample /root/direwolf/multi_modem.c:325:6
    #2 0x4e8534 in main /root/direwolf/atest.c:551:13
    #3 0x7fac7fa7ab44 in __libc_start_main /build/glibc-6V9RKT/glibc-2.19/csu/libc-start.c:287
    #4 0x41cfeb in _start (/root/direwolf/atest+0x41cfeb)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior demod_afsk.c:1125:34

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions