<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>36113</bug_id>
          
          <creation_ts>2019-02-15 19:08:26 +0300</creation_ts>
          <short_desc>network/socket.c: Don&apos;t take address of a pointer</short_desc>
          <delta_ts>2019-09-17 15:12:46 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>elinks</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ivan A. Melnikov">iv</reporter>
          <assigned_to name="Vladislav Zavjalov">slazav</assigned_to>
          <cc>at</cc>
    
    <cc>george</cc>
    
    <cc>glebfm</cc>
    
    <cc>slazav</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>178606</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2019-02-15 19:08:26 +0300</bug_when>
    <thetext>Build of elinks 0.12-alt0.12.2 failed with the following error when compiling src/network/socket.c:

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


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

http://git.altlinux.org/people/iv/packages/elinks.git?p=elinks.git;a=commit;h=f18a0f75ce08aea730b5f7fb8085b3a4a007d768

Please apply it to the next Sisyphus build.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>178607</commentid>
    <comment_count>1</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2019-02-15 19:10:29 +0300</bug_when>
    <thetext>It worth pointing out that currently the bug is present in upstream&apos;s master branch:

https://repo.or.cz/elinks.git/blob/f86be659718c0cd0a67f88b42f07044c23d0d028:/src/network/socket.c#l408

But I&apos;m not sure how to report it: their bugizilla seems to be down, and their mailing lists info looks outdated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184329</commentid>
    <comment_count>2</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2019-09-17 10:43:31 +0300</bug_when>
    <thetext>Создан 

task #237667: added #100: build tag &quot;0.12-alt0.12.4&quot; 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 только в исправлении этого бага:
http://git.altlinux.org/people/iv/packages/elinks.git?p=elinks.git;a=commitdiff;h=8d270d29c8272f81ec2b6fcfbef46327b65d6568
http://git.altlinux.org/people/iv/packages/elinks.git?p=elinks.git;a=commitdiff;h=af298496bc0e97a066896aa92a6b83ffca550e1c</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184338</commentid>
    <comment_count>3</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2019-09-17 15:12:46 +0300</bug_when>
    <thetext>elinks-0.12-alt0.12.4 -&gt; sisyphus:

Tue Sep 17 2019 Ivan A. Melnikov &lt;iv@altlinux&gt; 0.12-alt0.12.4
- fix double dereference (closes: #36113)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>