Skip to content

siputils: walk back from the uri in contact_param_encode() - #4966

Merged
miconda merged 1 commit into
kamailio:masterfrom
darkdi:siputils-contact-encode-walk-back
Sep 30, 2026
Merged

miconda merged 1 commit into
kamailio:masterfrom
darkdi:siputils-contact-encode-walk-back

Conversation

@darkdi

@darkdi darkdi commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Pre-Submission Checklist

  • Commit message has the format required by CONTRIBUTING guide
  • Commits are split per component (core, individual modules, libs, utils, ...)
  • Each component has a single commit (if not, squash them into one commit)
  • LLM/AI Coding Assistants were involved in creating the C code or other included content
  • Code is formatted with clang-format using the config file .clang-format
    from source code folder
  • No commits to README files for modules (changes must be done to docbook files
    in doc/ subfolder, the README file is autogenerated)

Type Of Change

  • Small bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would change existing functionality)

Checklist:

  • PR should be backported to stable branches
  • Tested changes locally
  • Related to issue #XXXX (replace XXXX with an open issue number)

Description

Spotted this next to the tm one. The loop should walk back from the uri looking for '<', but with p++ it steps into the uri and stops with q=1. A plain <sip:...> still works since '<' is right before the uri, but I think < sip:...> would get a second pair of brackets. Checked the loop alone on a few header strings, not a full run.

- the loop looking for '<' before the contact uri started one char
  before it but advanced with p++, so it stepped into the uri and
  stopped there; walk backwards instead
- the whitespace check tested '\n' twice, the second one meant '\r'
@miconda
miconda merged commit 2c2a2f3 into kamailio:master Sep 30, 2026
13 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