Bug 12956 - add new user or change user password will not succeed
Summary: add new user or change user password will not succeed
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 major
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-27 00:57 UTC by Semon Zhang
Modified: 2020-05-27 00:57 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
the fix to the passwd issue (769 bytes, patch)
2020-05-27 00:57 UTC, Semon Zhang
Details

Note You need to log in before you can comment on or make changes to this bug.
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