Skip to content

printf %'d segfault/bus error on bad input #1004

Description

@adavies42

this is on an M5 mac; on x86_64 linux, the crash is a segfault:

$ ksh
$ echo $KSH_VERSION                                                                                                                                                                                                                                                                                                                                                                                                                   
Version AJM 93u+m/1.0.10 2024-08-01
$ locale                     
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=
$ printf $'%\'d\n' 1,2m34    
ksh: printf: 1,2m34: arithmetic syntax error
Bus error: 10              ksh
$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions