Skip to content

fix: parse standard UUID text representation - #1272

Open
tianrking wants to merge 1 commit into
eclipse-zenoh:mainfrom
tianrking:agent/fix-standard-uuid-parse
Open

fix: parse standard UUID text representation#1272
tianrking wants to merge 1 commit into
eclipse-zenoh:mainfrom
tianrking:agent/fix-standard-uuid-parse

Conversation

@tianrking

@tianrking tianrking commented Jul 26, 2026

Copy link
Copy Markdown

Description

What does this PR do?

  • Correct the final dash position used when parsing the standard UUID text representation (8-4-4-4-12).
  • Add a regression test that converts 00112233-4455-6677-8899-aabbccddeeff to the expected 16 bytes.

Why is this change needed?

The parser skipped the last dash two characters too early, so standard UUID strings were decoded with incorrect bytes. This restores compatibility with RFC-style UUID strings used by other libraries and configuration producers.

Validation

  • Built the z_utils_test target with CMake/Ninja and MSVC.
  • Ran z_utils_test.exe successfully.
  • ctest -R '^z_utils_test$' --output-on-failure — 1/1 passed.

Related Issues

Fixes #1229.

Development disclosure

OpenAI Codex assisted with the implementation and test development. The patch was independently cross-reviewed and validated with MSVC as well as a GCC/AddressSanitizer test run.


🏷️ Label-Based Checklist

Based on the labels applied to this PR, please complete these additional requirements:

Labels: bug

🐛 Bug Fix Requirements

Since this PR is labeled as a bug fix, please ensure:

  • Root cause documented - Explain what caused the bug in the PR description
  • Reproduction test added - Test that fails on main branch without the fix
  • Test passes with fix - The reproduction test passes with your changes
  • Regression prevention - Test will catch if this bug reoccurs in the future
  • Fix is minimal - Changes are focused only on fixing the bug
  • Related bugs checked - Verified no similar bugs exist in related code

Why this matters: Bugs without tests often reoccur.

Instructions:

  1. Check off items as you complete them (change - [ ] to - [x])
  2. The PR checklist CI will verify these are completed

This checklist updates automatically when labels change, but preserves your checked boxes.

Signed-off-by: tianrking <10758833+tianrking@users.noreply.github.com>
@tianrking
tianrking marked this pull request as draft July 26, 2026 17:27
@tianrking
tianrking marked this pull request as ready for review July 26, 2026 17:41
@tianrking
tianrking marked this pull request as draft July 26, 2026 18:05
@tianrking
tianrking marked this pull request as ready for review July 26, 2026 18:06
@DenisBiryukov91 DenisBiryukov91 added the bug Something isn't working label Jul 27, 2026
@DenisBiryukov91

Copy link
Copy Markdown
Contributor

Hello @tianrking . Thanks for your contribution. Could you please sign eclipse eca https://www.eclipse.org/legal/eca/?

@tianrking

Copy link
Copy Markdown
Author

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] UUID bytes from string doesn't follow the standard UUID textual representation

2 participants