Bug 1677247 - history_list should return a NULL terminated list
Summary: history_list should return a NULL terminated list
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libedit
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Boris Ranto
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-02-14 11:07 UTC by Remi Collet
Modified: 2019-05-14 00:59 UTC (History)
4 users (show)

Fixed In Version: libedit-3.1-27.20190324cvs.fc30
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-14 00:59:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
history_list.patch (600 bytes, patch)
2019-02-14 11:07 UTC, Remi Collet
no flags Details | Diff

Description Remi Collet 2019-02-14 11:07:33 UTC
Created attachment 1534748 [details]
history_list.patch

Working on PHP readline extension, I try to introduce the readline_list_history missing function (only available when using libreadline), thanks to history_list introduce in 3.1

The current implementation rely on a NULL terminated list

	history = history_list();

	if (history) {
		int i;
		for (i = 0; history[i]; i++) {
			add_next_index_string(return_value, history[i]->line);
		}
	}


This badly segfault when using libedit

As I don't find a proper way to contact upstream, I attached a patch about this.

BTW, for PHP, we'll have to use 3 differents implementations, for now :(
https://github.com/php/php-src/pull/3824

Comment 1 Fedora Update System 2019-05-11 23:24:57 UTC
libedit-3.1-27.20190324cvs.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-e2103a77ec

Comment 2 Fedora Update System 2019-05-12 00:45:31 UTC
libedit-3.1-27.20190324cvs.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-e2103a77ec

Comment 3 Fedora Update System 2019-05-14 00:59:39 UTC
libedit-3.1-27.20190324cvs.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.


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