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

Initialize last_dibit variable #119

Merged
merged 1 commit into from
Mar 14, 2022

Conversation

argilo
Copy link
Contributor

@argilo argilo commented Dec 25, 2021

A segfault can occur because last_dibit is uninitialized and used as an index in a lookup table (in estimate_symbol).

This was reported in argilo/gr-dsd#15 and fixed in argilo/gr-dsd#19. Since the fix works well in gr-dsd, I'm contributing the fix upstream.

@szechyjs szechyjs merged commit 59423fa into szechyjs:master Mar 14, 2022
peads pushed a commit to peads/dsd that referenced this pull request Feb 7, 2023
peads added a commit to peads/dsd that referenced this pull request Oct 3, 2023
* cmake: fix portaudio linking issue (szechyjs#103)

* Fixing multiple definitions of exitflag (szechyjs#104) (szechyjs#105)

Thanks to N0YKG for the fix! I am just making the PR :)

* Create codeql-analysis.yml

* Install deps

* Initialize last_dibit variable (szechyjs#119)

* Refactored dsd_mbe::playMbeFile to properly handle eof and closing the currently read file, which was causing segfaults for large numbers of mbe files being read in. Extracted reader function calls to typedefed pointer, s.t. since the file type only needs to be read per file, it could be set to a generic function pointer thus cleaning up the read loop. Fixed end conditions for both the while and for loops, s.t. they break on exit flag, and their respective conditions. Removed redundant cleanup function call since the caller calls it on return of the play function anyway.

* Added default case, and fixed while loop condition.

* Added a bunch of file helper functions to handle error checking.

* Added file open helper function. Refactored file error handler to be extensible beyond EOF being defined as -1 in glibc. Changed expected EOF in playMbeFile to be handled specially (i.e. not sent to error handler) because it's more likely than not to be expected, and in any case, we can just trying playing the next file.

* Made print in play function respect the quiet flag

* reverted CMakeLists change

* reverted CMakeLists change

* reverted CMakeLists change, I should've just used sed

---------

Co-authored-by: ra1nb0w <[email protected]>
Co-authored-by: Yinette Hodge <[email protected]>
Co-authored-by: Jared Szechy <[email protected]>
Co-authored-by: Clayton Smith <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants