diff options
author | vchoi-hdfgroup <55293060+vchoi-hdfgroup@users.noreply.github.com> | 2023-08-25 13:13:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-25 13:13:04 (GMT) |
commit | e7bb05a8869f460afe9f198e9b7eee4a11972d48 (patch) | |
tree | 66dfe6fb24d2062d2f01f97e39c08ec617d66381 /tools | |
parent | f6df114fa2f72bc6eadcae444e23af7e25e079d4 (diff) | |
download | hdf5-e7bb05a8869f460afe9f198e9b7eee4a11972d48.zip hdf5-e7bb05a8869f460afe9f198e9b7eee4a11972d48.tar.gz hdf5-e7bb05a8869f460afe9f198e9b7eee4a11972d48.tar.bz2 |
Fix for CVE-2018-15671. h5stat -S $POC will result in a crash with segmenetation fault. (#3427)
It is because the object in the testfile points back to the root group.
When the tool tries to traverse the object, it goes back to the root group and then back again.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/src/h5dump/h5dump_ddl.c | 9 | ||||
-rw-r--r-- | tools/testfiles/tgroup-2.ddl | 9 |
2 files changed, 2 insertions, 16 deletions
diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c index 8a02a49..adc8585 100644 --- a/tools/src/h5dump/h5dump_ddl.c +++ b/tools/src/h5dump/h5dump_ddl.c @@ -853,10 +853,7 @@ dump_group(hid_t gid, const char *name) H5Oget_info3(gid, &oinfo, H5O_INFO_BASIC); - /* Must check for uniqueness of all objects if we've traversed an elink, - * otherwise only check if the reference count > 1. - */ - if (oinfo.rc > 1 || hit_elink) { + { obj_t *found_obj; /* Found object */ found_obj = search_obj(group_table, &oinfo.token); @@ -880,10 +877,6 @@ dump_group(hid_t gid, const char *name) link_iteration(gid, crt_order_flags); } } - else { - attr_iteration(gid, attr_crt_order_flags); - link_iteration(gid, crt_order_flags); - } dump_indent -= COL; ctx.indent_level--; diff --git a/tools/testfiles/tgroup-2.ddl b/tools/testfiles/tgroup-2.ddl index 2ac8ac6..5374742 100644 --- a/tools/testfiles/tgroup-2.ddl +++ b/tools/testfiles/tgroup-2.ddl @@ -17,14 +17,7 @@ GROUP "/" { } } GROUP "g2" { - GROUP "g2.1" { - GROUP "g2.1.1" { - } - GROUP "g2.1.2" { - } - GROUP "g2.1.3" { - } - } + HARDLINK "/g2" } GROUP "g3" { GROUP "g3.1" { |