[PATCH 1/3] virfilemock: Init symbols in canonicalize_file_name()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If a program that is using this mock calls canonicalize_file_name()
as the very first function then it will face SIGSEGV because
real_canonicalize_file_name is uninitialized.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 tests/virfilemock.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/virfilemock.c b/tests/virfilemock.c
index 89e14c5b67..106032f857 100644
--- a/tests/virfilemock.c
+++ b/tests/virfilemock.c
@@ -177,6 +177,9 @@ statfs(const char *path, struct statfs *buf)
 char *
 canonicalize_file_name(const char *path)
 {
+
+    init_syms();
+
     if (getenv("LIBVIRT_MTAB")) {
         const char *p;
         char *ret;
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux