Bug 1677247

Summary: history_list should return a NULL terminated list
Product: [Fedora] Fedora Reporter: Remi Collet <fedora>
Component: libeditAssignee: Boris Ranto <branto>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: branto, debarshir, jeff, loganjerry
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libedit-3.1-27.20190324cvs.fc30 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 00:59:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
history_list.patch none

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.