ipdbg-la: Check if limit samples is valid (leq size of ringuffer)

This commit is contained in:
Daniel Anselmi 2018-12-04 01:55:00 +01:00 committed by Uwe Hermann
parent 942719b46c
commit f3549a1ccf
1 changed files with 5 additions and 1 deletions

View File

@ -207,7 +207,11 @@ static int config_set(uint32_t key, GVariant *data,
devc->capture_ratio = g_variant_get_uint64(data);
break;
case SR_CONF_LIMIT_SAMPLES:
devc->limit_samples = g_variant_get_uint64(data);
{
uint64_t limit_samples = g_variant_get_uint64(data);
if (limit_samples <= devc->limit_samples_max)
devc->limit_samples = limit_samples;
}
break;
default:
return SR_ERR_NA;