Skip to content

[4.4] libatalk: fix OOB access when "end_of_list_marker" is passed as logtype#2904

Merged
andylemin merged 1 commit intobranch-netatalk-4-4from
rdmark-logtype-oob-4.4
Apr 19, 2026
Merged

[4.4] libatalk: fix OOB access when "end_of_list_marker" is passed as logtype#2904
andylemin merged 1 commit intobranch-netatalk-4-4from
rdmark-logtype-oob-4.4

Conversation

@rdmark
Copy link
Copy Markdown
Member

@rdmark rdmark commented Apr 19, 2026

The bound check in setuplog_internal() compared typenum against num_logtype_strings, which includes the sentinel "end_of_list_marker" entry. This allowed typenum == logtype_end_of_list_marker (11) to pass the guard and index type_configs[] out of bounds (sized for indices 0-10).

Fix by comparing against logtype_end_of_list_marker directly, which is the actual size of type_configs[].

The bound check in setuplog_internal() compared typenum against
num_logtype_strings, which includes the sentinel "end_of_list_marker"
entry. This allowed typenum == logtype_end_of_list_marker (11) to pass
the guard and index type_configs[] out of bounds (sized for indices 0-10).

Fix by comparing against logtype_end_of_list_marker directly, which is
the actual size of type_configs[].
@rdmark rdmark requested a review from andylemin April 19, 2026 07:22
@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Apr 19, 2026

🤖 Augment PR Summary

Summary: Fixes an out-of-bounds access in the logger when the sentinel logtype string is provided.

Changes: Updates setuplog_internal() to bounds-check typenum against logtype_end_of_list_marker (matching type_configs[] size) instead of num_logtype_strings (which includes the sentinel).

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@sonarqubecloud
Copy link
Copy Markdown

@andylemin andylemin merged commit 49d879d into branch-netatalk-4-4 Apr 19, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants