Skip to content

possibly dangerous warning when compiling #2

Open
@VictorQueiroz

Description

@VictorQueiroz

I get this warning when compiling the common repo from GitLab(seems to be the most updated one). Is this dangerous?

/home/victorqueiroz/Personal/libshout/icecast-common/common/net/sock.c: In function ‘sock_try_connection’:
/home/victorqueiroz/Personal/libshout/icecast-common/common/net/sock.c:716:5: warning: ‘memcpy’ writing 16 bytes into a region of size 12 overflows the destination [-Wstringop-overflow=]
  716 |     memcpy(&server.sin_addr, &sin.sin_addr, sizeof(struct sockaddr_in));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/victorqueiroz/Personal/libshout/icecast-common/common/net/sock.c:695:29: note: at offset 4 into destination object ‘server’ of size 16
  695 |     struct sockaddr_in sin, server;
      |                             ^~~~~~

I am willing to help with a PR.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions