Bug 12956

Summary: add new user or change user password will not succeed
Product: Busybox Reporter: Semon Zhang <giantbull>
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: major CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:
Attachments: the fix to the passwd issue

Description Semon Zhang 2020-05-27 00:57:22 UTC
Created attachment 8476 [details]
the fix to the passwd issue

when try to add new user with password assigned, after enter user password and confirmed, it will show "invalid pointer" error on the console

====================================
 adduser test
Changing password for test
New password:
Bad password: too short
Retype password:
*** Error in `passwd': munmap_chunk(): invalid pointer: 0x0000000120255438 ***
[   44.117187] IPVS: Creating netns size=1280 id=2
Aborted (core dumped)
#
=====================================

the reason is that in file loginutils/passwd.c, function new_password, variable

char *orig = (char*)"";

is allocated statically, but later it memory will be release by free() function

the fix is attached