aboutsummaryrefslogtreecommitdiff
path: root/contrib/vhost-user-input
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/vhost-user-input')
-rw-r--r--contrib/vhost-user-input/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/vhost-user-input/main.c b/contrib/vhost-user-input/main.c
index 3ea840cf44..d2de47cee7 100644
--- a/contrib/vhost-user-input/main.c
+++ b/contrib/vhost-user-input/main.c
@@ -211,7 +211,9 @@ static int vi_get_config(VuDev *dev, uint8_t *config, uint32_t len)
{
VuInput *vi = container_of(dev, VuInput, dev.parent);
- g_return_val_if_fail(len <= sizeof(*vi->sel_config), -1);
+ if (len > sizeof(*vi->sel_config)) {
+ return -1;
+ }
if (vi->sel_config) {
memcpy(config, vi->sel_config, len);