Bug 840598
| Summary: | el_insertstr() crashes on incomplete multi-byte sequence | |||
|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | rustyBSD <rustyBSD> | |
| Component: | libedit | Assignee: | Kamil Dudka <kdudka> | |
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | |
| Severity: | unspecified | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | 17 | CC: | jeff, kdudka, loganjerry, mattias.ellert, mgrepl, plautrba, tmraz | |
| Target Milestone: | --- | |||
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | libedit-3.0-7.20120601cvs.fc18 | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 841771 (view as bug list) | Environment: | ||
| Last Closed: | 2012-07-20 08:46:45 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: | ||||
|
Description
rustyBSD
2012-07-16 16:25:09 UTC
This is most probably a problem with libedit. Thanks for the bug report, will look at the issue closer on Wednesday hopefully. This fixes the SIGSEGV in libedit:
diff --git a/src/chared.c b/src/chared.c
index 0a95913..1b6fa68 100644
--- a/src/chared.c
+++ b/src/chared.c
@@ -612,7 +612,7 @@ FUN(el,insertstr)(EditLine *el, const Char *s)
{
size_t len;
- if ((len = Strlen(s)) == 0)
+ if (s == NULL || (len = Strlen(s)) == 0)
return -1;
if (el->el_line.lastchar + len >= el->el_line.limit) {
if (!ch_enlargebufs(el, len))
However, if you want sftp to actually support UTF-8, you need to fix sftp so that complete_match() does not call el_insertstr() with incomplete multibyte sequences.
fixed in libedit-3.0-7.20120601cvs.fc18 I am not going to backport the fix for stable Fedora. Running the broken sftp on top of fixed libedit leaves the terminal in an inconsistent state, so the SIGSEGV is actually a better response from user's point of view. This really needs to be fixed in sftp -- I have cloned the bug for openssh: bug #841771 |