Bug 2160647 - tlock: Fix missing prototype for crypt (pointer truncation)
Summary: tlock: Fix missing prototype for crypt (pointer truncation)
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: tlock
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: pjp
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PortingToModernCNoUpstream
TreeView+ depends on / blocked
 
Reported: 2023-01-13 07:22 UTC by Florian Weimer
Modified: 2023-01-13 07:48 UTC (History)
1 user (show)

Fixed In Version: tlock-1.6-17.fc38
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-01-13 07:48:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
tlock-c99.patch (613 bytes, patch)
2023-01-13 07:35 UTC, Florian Weimer
no flags Details | Diff

Description Florian Weimer 2023-01-13 07:22:19 UTC
The lock_user function has:

    passwd1 = readpass (PROMPT, DISPLAY, PASS_LEN);    /* read password */
    passwd2 = (char *) crypt (passwd1, salt);
    free (passwd1);
    passwd1 = calloc (strlen (passwd2) + 1, sizeof (char));
    strcpy (passwd1, passwd2);

But crypt is not declared, which means that the return value of crypt is clipped to 32 bits, likely resulting in crashes on 64-bit architectures.

Part of C99 porting. Upstream does not seem to have a bug tracker, so filing it here.

Comment 1 Florian Weimer 2023-01-13 07:35:07 UTC
Created attachment 1937754 [details]
tlock-c99.patch


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