From f3549a1ccf7bacdc13827e58c96912da7c631a67 Mon Sep 17 00:00:00 2001 From: Daniel Anselmi Date: Tue, 4 Dec 2018 01:55:00 +0100 Subject: [PATCH] ipdbg-la: Check if limit samples is valid (leq size of ringuffer) --- src/hardware/ipdbg-la/api.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hardware/ipdbg-la/api.c b/src/hardware/ipdbg-la/api.c index c24eb908..f3de8e63 100644 --- a/src/hardware/ipdbg-la/api.c +++ b/src/hardware/ipdbg-la/api.c @@ -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;