HDFGroup / HDFGroup/hdf5

Link iteration bypasses passthrough connectors when providing info to callbacks

Open
#5,426 0 comments 0 reactions 1 assignee Claimed by @mattjala View on GitHub
Component - C Library
Dominant language
C
Stars
988
Forks
355
Avg merge
4d 2h
Merged PRs (30d)
12

Description

**Describe the bug**
When using a Passthrough VOL connector that modifies link values, link iteration callbacks invoked through `H5Literate2()` will be passed link information corresponding to the link as seen by the terminal VOL connector, rather than the link as seen by the user-application. This can lead to unexpected problems like invalid memory accesses when users attempt to operate on the link value through the API.

This was discovered while using a Passthrough Connector that internally adds a suffix to filenames, and adds the same suffix to the value of external links for consistency. As such, within a link callback, attempting to use the link length provided by the iteration to operate on the link value accessed through `H5Lget_val()` would lead to an out-of-bounds access - the length includes the suffix, but the value and buffer accessed through the API lack the suffix and is shorter than expected.

See #5423, #5406

**Expected behavior**
Iteration callbacks should be provided with link information which matches what can be retrieved by direct use of `H5Lget_info()`, even when passthrough VOL connectors are active.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.