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

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

Closed
geeknik opened this issue Jul 30, 2017 · 1 comment

Comments

@geeknik
Copy link

geeknik commented Jul 30, 2017

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
@wb2osz
Copy link
Owner

wb2osz commented Jul 31, 2017

Thanks for finding this.
Fixed in 9e940b0 on dev branch.

@wb2osz wb2osz closed this as completed Jul 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants