-
Notifications
You must be signed in to change notification settings - Fork 259
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
Bounds checking issue in stream args #534
Comments
Right, since the master is no longer the master I reproduced the original code here: if (dev) {
args = dev->getSoapyDevice()->getStreamArgsInfo(SOAPY_SDR_RX, 0);
if (args.size()) {
for (args_i = args.begin(); args_i != args.end(); args_i++) {
SoapySDR::ArgInfo arg = (*args_i);
wxPGProperty *prop = streamProps[arg.key];
if (arg.type == SoapySDR::ArgInfo::STRING && arg.options.size()) {
streamArgs[arg.key] = arg.options[prop->GetChoiceSelection()]; // <<<<< HERE.
} else if (arg.type == SoapySDR::ArgInfo::BOOL) {
streamArgs[arg.key] = (prop->GetValueAsString()=="True")?"true":"false";
} else {
streamArgs[arg.key] = prop->GetValueAsString();
}
}
}
} |
vsonnier
added a commit
that referenced
this issue
Mar 21, 2018
vsonnier
added a commit
that referenced
this issue
Mar 21, 2018
This is the same as the #634, so close this old one as duplicate. |
tgunr
added a commit
to tgunr/CubicSDR
that referenced
this issue
Mar 21, 2018
* 'master' of https://github.com/cjcliffe/CubicSDR: Fix cjcliffe#634 plus cjcliffe#534: bound checking in SDRDevices dialog selection Fixes for cjcliffe#635, round 1: BookmarkView
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Due to unspecified default when using a list of options, we got an index that was outside of the options size and a segfault. I'm fixing the issue in the LimeSuite, but just a note in case you want to do bounds checking here, get a warning, or safely pick element 0, rather than now it can bomb out:
The text was updated successfully, but these errors were encountered: