Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not segfault when loading empty XML files
$ touch empty.xml $ sysrepocfg --import=empty.xml --format=xml --datastore=running ThreadSanitizer:DEADLYSIGNAL ==12949==ERROR: ThreadSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f8b121637f8 bp 0x000000000001 sp 0x7fff4257f350 T12949) ==12949==The signal is caused by a READ memory access. ==12949==Hint: address points to the zero page. #0 lyxml_parse_mem /home/jkt/work/cesnet/gerrit/CzechLight/cla-sysrepo/submodules/dependencies/libyang/src/xml.c:1257:14 (libyang.so.1+0x377f8) CESNET#1 lyd_parse_ /home/jkt/work/cesnet/gerrit/CzechLight/cla-sysrepo/submodules/dependencies/libyang/src/tree_data.c:951:15 (libyang.so.1+0xb7e79) CESNET#2 lyd_parse_data_ /home/jkt/work/cesnet/gerrit/CzechLight/cla-sysrepo/submodules/dependencies/libyang/src/tree_data.c:1039:12 (libyang.so.1+0xa6476) CESNET#3 lyd_parse_fd_ /home/jkt/work/cesnet/gerrit/CzechLight/cla-sysrepo/submodules/dependencies/libyang/src/tree_data.c:1074:11 (libyang.so.1+0xa66be) CESNET#4 lyd_parse_path /home/jkt/work/cesnet/gerrit/CzechLight/cla-sysrepo/submodules/dependencies/libyang/src/tree_data.c:1117:11 (libyang.so.1+0xa67e1) CESNET#5 step_load_data /home/jkt/work/cesnet/gerrit/CzechLight/cla-sysrepo/submodules/dependencies/sysrepo/src/executables/sysrepocfg.c:235:17 (sysrepocfg+0x4d3041) CESNET#6 op_import /home/jkt/work/cesnet/gerrit/CzechLight/cla-sysrepo/submodules/dependencies/sysrepo/src/executables/sysrepocfg.c:299:9 (sysrepocfg+0x4d206a) CESNET#7 main /home/jkt/work/cesnet/gerrit/CzechLight/cla-sysrepo/submodules/dependencies/sysrepo/src/executables/sysrepocfg.c:871:14 (sysrepocfg+0x4d1832) CESNET#8 __libc_start_main <null> (libc.so.6+0x23dbc) CESNET#9 _start /build/glibc-2.32/csu/../sysdeps/x86_64/start.S:120 (sysrepocfg+0x4235d9) Fixes: sysrepo/sysrepo#2294
- Loading branch information