Bug 173241 - useradd segfaults
useradd segfaults
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: shadow-utils (Show other bugs)
rawhide
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-15 10:50 EST by Dave Jones
Modified: 2015-01-04 17:23 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-11-16 08:37:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Dave Jones 2005-11-15 10:50:26 EST
to repeat..

declare -x MALLOC_PERTURB_="204"
useradd foo

(gdb) run foo
Starting program: /usr/sbin/useradd moo

Program received signal SIGSEGV, Segmentation fault.
0x00000033b78723f0 in strcmp () from /lib64/libc.so.6
(gdb) bt
#0  0x00000033b78723f0 in strcmp () from /lib64/libc.so.6
#1  0x00000000004042d6 in usr_update () at useradd.c:736
#2  0x000000000040531c in main (argc=2, argv=0x7ffffff8ee08) at useradd.c:1834
#3  0x00000033b781cd2f in __libc_start_main () from /lib64/libc.so.6
#4  0x0000000000402999 in _start ()
#5  0x00007ffffff8edf8 in ?? ()
#6  0x0000000000000000 in ?? ()
(gdb)
Comment 1 Peter Vrabec 2005-11-16 06:03:39 EST
fix:
@@ -1490,6 +1702,7 @@

        sys_ngroups = sysconf (_SC_NGROUPS_MAX);
        user_groups = malloc ((1 + sys_ngroups) * sizeof (char *));
+       user_groups[0] = (char *) 0; /* Initialize the list to be empty */

        is_shadow_pwd = spw_file_present ();

Note You need to log in before you can comment on or make changes to this bug.