Skip to content

Miscellaneous fixes#29

Merged
kosmas-valianos merged 3 commits intomainfrom
moreMisc
Mar 23, 2026
Merged

Miscellaneous fixes#29
kosmas-valianos merged 3 commits intomainfrom
moreMisc

Conversation

@kosmas-valianos
Copy link
Copy Markdown
Owner

No description provided.

- Fix TLV loop off-by-one: use >= so zero-length TLVs at buffer tail are processed
- Fix uint16_t overflows in pp_info_add_aws_vpce_id, pp_info_add_netns, tlv_array_append_tlv_new_usascii
- Fix SSL sub-TLV bounds: require full header before read, validate sub-TLV length, reject trailing bytes
- Fix uint16_t overflow in pp2_tlv_offset: use uint32_t to prevent infinite loop on large TLV lengths
- Fix SSL TLV minimum length check: validate pp2_tlv_len >= 5 before accessing fields
- Fix NOOP padding heap overflow: add padding_bytes > 0 guard
- Fix v1 parser: change || to && for UNKNOWN header, use PP1_MAX_LENGTH - 1 to preserve null terminator
- Add NULL checks in pp_info_add_netns and pp_info_add_aws_vpce_id
- Eliminate switch fallthrough and remove -Wimplicit-fallthrough=0 from Makefile for portability
- Refactor Azure parser to use tlv_array_append_tlv_new() wrapper
- Add explicit casts for pointer subtraction and strlen results to suppress MSVC 64-bit warnings
- Add 5 unit tests for TLV overflow, SSL too short, SSL trailing bytes, v1 invalid family, v1 no CRLF
@kosmas-valianos kosmas-valianos changed the title Simplify PP2_SUBTYPE_AZURE_PRIVATEENDPOINT_LINKID parsing Miscellaneous fixes Mar 16, 2026
- Fix uint16_t overflow in pp2_create_hdr: accumulate TLV lengths in uint32_t, check > UINT16_MAX before truncating
- Fix memory leak in test harness: free raw_bytes_in buffer after pp_parse_hdr
- Fix MSVC C4244 warning: cast _sprintf return to uint16_t in pp1_create_hdr
- Fix parse_port: reject leading + prefix and trailing non-digit characters
- Add tests for parse_port strictness (+ prefix, trailing garbage) and pp_info_add_* NULL/length guards
@kosmas-valianos kosmas-valianos merged commit 1cb55f0 into main Mar 23, 2026
2 checks passed
@kosmas-valianos kosmas-valianos deleted the moreMisc branch March 23, 2026 14:42
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.

1 participant