Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 167152 - dev-libs/cyrus-sasl-2.1.22-r1 auth_shadow SIGSEGV on 64-bit archs
Summary: dev-libs/cyrus-sasl-2.1.22-r1 auth_shadow SIGSEGV on 64-bit archs
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-16 03:59 UTC by Chris Humbert
Modified: 2007-10-28 21:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Humbert 2007-02-16 03:59:56 UTC
cyrus-sasl-2.1.22/saslauthd/auth_shadow.c needs to #include <crypt.h>

auth_shadow.c: In function 'auth_shadow':
auth_shadow.c:183: warning: implicit declaration of function 'crypt'
auth_shadow.c:183: warning: cast to pointer from integer of different size

Program received signal SIGSEGV, Segmentation fault.
0x0002aaaaaf86d80 in strlen ()
(gdb) bt
#0  0x00002aaaaaf86d80 in strlen () from /lib/libc.so.6
#1  0x00002aaaaaf86a96 in strdup () from /lib/libc.so.6
#2  0x0000000000403846 in auth_shadow (login=0x7fff3deacd90 "username",
    password=0x7fff3deacc80 "password", service=<value optimized out>,
    realm=<value optimized out>) at auth_shadow.c:183
#3  0x0000000000406d91 in do_auth (_login=<value optimized out>,
    password=0x6b7f0d8a <Address 0x6b7f0d8a out of bounds>,
    service=0x7fff3deacb70 "smtp", realm=0x7fff3deaca60 "")
    at saslauthd-main.c:399
#4  0x0000000000405b02 in do_request (conn_fd=7) at ipc_unix.c:426
#5  0x0000000000405cc7 in ipc_loop () at ipc_unix.c:277
#6  0x000000000040749d in main (argc=3, argv=<value optimized out>)
    at saslauthd-main.c:358


The implicit crypt()'s return type defaults to int, so the returned 64-bit pointer is truncated to 32-bits:
    cpw = strdup((const char *)crypt(password, sp->sp_pwdp));

  4038d9:       e8 52 e3 ff ff          callq  401c30 <crypt@plt>
  4038de:       48 63 f8                movslq %eax,%rdi
  4038e1:       e8 da e5 ff ff          callq  401ec0 <strdup@plt>
Comment 1 Torsten Veller (RETIRED) gentoo-dev 2007-10-28 21:21:30 UTC
Thanks for your report.

This bug was fixed in 2.1.22-r2 by adding "append-flags -D_XOPEN_SOURCE"

If it doesn't work, please reopen this bug.