From: Michal Privoznik Date: Mon, 6 May 2019 14:08:34 +0000 (+0200) Subject: virfilemock: Init symbols in canonicalize_file_name() X-Git-Tag: v5.4.0-rc1~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd5ae5f240061248415f9095a006a376042f6887;p=thirdparty%2Flibvirt.git virfilemock: Init symbols in canonicalize_file_name() 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 --- 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;