Skip to content

Link iteration bypasses passthrough connectors when providing info to callbacks #5426

@mattjala

Description

@mattjala

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.

Metadata

Metadata

Assignees

Labels

Component - C LibraryCore C library issues (usually in the src directory)

Type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions