This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/1012] New: gethostid() output sign-extended on 64-bit platforms


There is a signed int to signed long bug in gethostid() for 64-bit
platforms.  If the 31st bit of the hostid is a 1, it gets signed
extended to 64 bits.  It should instead be cast as an unsigned int on
return.  Example:

# hostid
ffffffffa2802df3

With the attached patch, it returns to the expected output:

# hostid
a2802df3

-- 
           Summary: gethostid() output sign-extended on 64-bit platforms
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: gotom at debian dot or dot jp
        ReportedBy: edwardsg at sgi dot com
                CC: drepper at redhat dot com,glibc-bugs at sources dot
                    redhat dot com


http://sources.redhat.com/bugzilla/show_bug.cgi?id=1012

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]