-
Notifications
You must be signed in to change notification settings - Fork 187
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
Access Violation in SoapySDRArgInfo #447
Comments
Looks related to https://github.com/pothosware/SoapySDR/pull/444/files Thanks for pointing this out. My thoughts about this
|
I like the second option more as it does not require changes in the calling code to handle nulls. The previous fix returns an array of nulls if option names are not present, which also requires special handling in the calling code. So the fix will be
|
Will |
The sdr driver is supposed to pass either two vectors of the same length, or an empty and non-empty vectors. If it returns |
Problem Description
The C wrapper around
SoapySDR::ArgInfo
looks like this:When
info.options
has elements butinfo.optionNames
doesn't,out.optionNames
is assigned a pointer to a zero-length memory. The calling code has no way to know that, when it tries to readnumOptions
entries from that memory, an AV exception is fired.Proposed Fix
Change
toStrArray
to returnNULL
whenstrs
has no entriesand make a corresponding change in
SoapySDRStrings_clear
:The text was updated successfully, but these errors were encountered: