Bug 36113 - network/socket.c: Don't take address of a pointer
Summary: network/socket.c: Don't take address of a pointer
Alias: None
Product: Sisyphus
Classification: Development
Component: elinks (show other bugs)
Version: unstable
Hardware: all Linux
: P3 normal
Assignee: Vladislav Zavjalov
QA Contact: qa-sisyphus
Depends on:
Reported: 2019-02-15 19:08 MSK by Ivan A. Melnikov
Modified: 2019-09-17 15:12 MSK (History)
4 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Ivan A. Melnikov 2019-02-15 19:08:26 MSK
Build of elinks 0.12-alt0.12.2 failed with the following error when compiling src/network/socket.c:

In function 'check_if_local_address6',
    inlined from 'connect_socket' at socket.c:578:13:
socket.c:404:12: error: '__builtin_memcmp_eq' reading 4 bytes from a region of size 0 [-Werror=stringop-overflow=]
        && !memcmp(&((struct sockaddr_in *) &addr)->sin_addr.s_addr,
     &((struct sockaddr_in *) ifa->ifa_addr)->sin_addr.s_addr,
     sizeof(((struct sockaddr_in *) &addr)->sin_addr.s_addr))) {
cc1: all warnings being treated as errors

Apparently, `addr` variable here is already a pointer, so we don't need to take its address once agan. With a trivial fix, the compilation completes successfully. Here's the fix:


Please apply it to the next Sisyphus build.
Comment 1 Ivan A. Melnikov 2019-02-15 19:10:29 MSK
It worth pointing out that currently the bug is present in upstream's master branch:


But I'm not sure how to report it: their bugizilla seems to be down, and their mailing lists info looks outdated.
Comment 2 Ivan A. Melnikov 2019-09-17 10:43:31 MSK

task #237667: added #100: build tag "0.12-alt0.12.4" from /people/iv/packages/elinks.git
task #237667: try #1 is AWAITING, result will be emailed to iv@altlinux.org

Отличия от 0.12-alt0.12.3 только в исправлении этого бага:
Comment 3 Repository Robot 2019-09-17 15:12:46 MSK
elinks-0.12-alt0.12.4 -> sisyphus:

Tue Sep 17 2019 Ivan A. Melnikov <iv@altlinux> 0.12-alt0.12.4
- fix double dereference (closes: #36113)