Skip to content

Resolve Build Warnings#153

Merged
rajulup merged 1 commit intoqualcomm:mainfrom
varunsinghal-Qualcomm:main
Jan 30, 2026
Merged

Resolve Build Warnings#153
rajulup merged 1 commit intoqualcomm:mainfrom
varunsinghal-Qualcomm:main

Conversation

@varunsinghal-Qualcomm
Copy link
Member

  1. Improve UNIX socket path length validation in client and server
  2. Use size_t for vector loop indices to avoid type issues
  3. Make SocketServer destructor virtual for safe cleanup
  4. Simplify CONCAT macro definition

memset(&addr, 0, sizeof(struct sockaddr_un));
addr.sun_family = AF_UNIX;
if(snprintf(addr.sun_path, UNIX_PATH_MAX, RESTUNE_SOCKET_PATH) >= UNIX_PATH_MAX) {
int written = snprintf(addr.sun_path, UNIX_PATH_MAX, RESTUNE_SOCKET_PATH);
Copy link
Contributor

Choose a reason for hiding this comment

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

lets declare written as size_t

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

addr.sun_family = AF_UNIX;
if(snprintf(addr.sun_path, UNIX_PATH_MAX, RESTUNE_SOCKET_PATH) >= UNIX_PATH_MAX) {
int written = snprintf(addr.sun_path, UNIX_PATH_MAX, RESTUNE_SOCKET_PATH);
if(written < 0 || static_cast<size_t>(written) >= UNIX_PATH_MAX) {
Copy link
Contributor

Choose a reason for hiding this comment

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

lets declare written as size_t

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Signed-off-by: varusing <varusing@qti.qualcomm.com>
@rajulup rajulup self-requested a review January 30, 2026 05:51
@rajulup rajulup merged commit 19859cf into qualcomm:main Jan 30, 2026
9 of 11 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.

3 participants