From fa7d0cc1e74cfc3fa2f268d37e3f8d8ac8728b49 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Fri, 21 Jun 2019 13:10:35 -0400 Subject: [PATCH] cpu_x86: Handle error in x86DataToCPU when calling x86DataAdd Commit 9c9620af called x86DataAdd without checking for an error, so add the error checking. Found by Coverity Signed-off-by: John Ferlan Reviewed-by: Michal Privoznik --- src/cpu/cpu_x86.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 978a60c90a..55b55da784 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -822,7 +822,8 @@ x86DataToCPU(const virCPUx86Data *data, for (blocker = hvModel->blockers; *blocker; blocker++) { if ((feature = x86FeatureFind(map, *blocker)) && !x86DataIsSubset(©, &feature->data)) - x86DataAdd(&modelData, &feature->data); + if (x86DataAdd(&modelData, &feature->data) < 0) + goto error; } }