php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80583 cli readline causes crash
Submitted: 2021-01-04 13:53 UTC Modified: 2021-01-04 14:05 UTC
From: jan dot hana at atlas dot cz Assigned:
Status: Verified Package: *Unicode Issues
PHP Version: 8.0.0 OS: Ubuntu 20.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2021-01-04 13:53 UTC] jan dot hana at atlas dot cz
Description:
------------
When using the Czech diacritics in readline parametter, whole application crashes.

It works in PHP 7.4.

Test script:
---------------
<?php
readline('doména ěščřžýáíé');

Actual result:
--------------
Neoprávněný přístup do paměti (SIGSEGV) (core dumped [obraz paměti uložen])

Translated to EN: Unauthorized Memory Access (SIGSEGV) (core dumped)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-01-04 14:05 UTC] nikic@php.net
-Status: Open +Status: Verified
 [2021-01-04 14:05 UTC] nikic@php.net
This works on 7.4 and 8.0:

var_dump(setlocale(LC_ALL, 'en_US.UTF-8'));
readline('doména ěščřžýáíé');

This crashes on 7.4 and 8.0:

var_dump(setlocale(LC_ALL, 'C'));
readline('doména ěščřžýáíé');

Locale-dependent crashes in libedit, this is horrible.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 24 09:01:26 2021 UTC