SHA256
1
0
forked from pool/libvirt
libvirt/4ab0c959-libxl-mem-leak.patch
James Fehlig 938d7e0b24 A few upstream patches to fix 79692c38-libxl-dom0-maxmem.patch
- libxl: more fixes for dom0 maxmem setting
  4ab0c959-libxl-mem-leak.patch, 2dc1cf19-libxl-double-free.patch
  bsc#1017762

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=584
2017-02-17 00:31:00 +00:00

26 lines
907 B
Diff

commit 4ab0c959e936de7fa2752160ff532913740d4da9
Author: John Ferlan <jferlan@redhat.com>
Date: Fri Feb 10 06:54:56 2017 -0500
libxl: Resolve possible resource leak in dom0 maximum memory setting
If either the "if (STRPREFIX(mem_tokens[j], "max:"))" is never entered
or the "if (virStrToLong_ull(mem_tokens[j] + 4, &p, 10, maxmem) < 0)" break
is hit, control goes back to the outer loop processing 'cmd_tokens' and
it's possible that the 'mem_tokens' would be overwritten.
Found by Coverity
Index: libvirt-3.0.0/src/libxl/libxl_conf.c
===================================================================
--- libvirt-3.0.0.orig/src/libxl/libxl_conf.c
+++ libvirt-3.0.0/src/libxl/libxl_conf.c
@@ -1622,6 +1622,7 @@ libxlDriverGetDom0MaxmemConf(libxlDriver
goto cleanup;
}
}
+ virStringListFree(mem_tokens);
}
physmem: