Skip to content

Fix const-correctness for pointer variables to referred strings#148

Open
kraj wants to merge 1 commit intosystemd:mainfrom
kraj:main
Open

Fix const-correctness for pointer variables to referred strings#148
kraj wants to merge 1 commit intosystemd:mainfrom
kraj:main

Conversation

@kraj
Copy link
Copy Markdown

@kraj kraj commented Apr 15, 2026

Mark pointer variables 'e' as 'const char *' in
config_parse_netlog_remote_address,file_in_same_dir, and socket_address_parse, since they point to memory they do not own or modify.

Summary

Brief description of the changes.

Fixes #(issue number)

Changes

Testing

  • meson test -C build passes
  • Tested with UDP/TCP/TLS as applicable
  • New code has test coverage (if applicable)

Checklist

  • Code follows systemd coding style
  • Commit messages are clear and descriptive
  • Documentation updated (if applicable)
  • No new compiler warnings

Mark pointer variables 'e' as 'const char *' in
config_parse_netlog_remote_address,file_in_same_dir, and
socket_address_parse, since they point to memory they do not
own or modify.

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
@ssahani
Copy link
Copy Markdown
Contributor

ssahani commented Apr 21, 2026

We do not do sign Off. Please drop that.

Also

git commit --amend -m "fix: constify pointer variables referring to strings

Ensure const-correctness by updating char* to const char* where strings are not modified.
Prevents accidental mutation of string literals and improves safety."

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants