FreeBSD Bugzilla – Attachment 201348 Details for
Bug 233343
[libedit] bind command reads out of bounds and sends output to stderr
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
sh.patch
sh.patch (text/plain), 984 bytes, created by
Yuichiro NAITO
on 2019-01-23 01:56:14 UTC
(
hide
)
Description:
sh.patch
Filename:
MIME Type:
Creator:
Yuichiro NAITO
Created:
2019-01-23 01:56:14 UTC
Size:
984 bytes
patch
obsolete
>Index: bin/sh/histedit.c >=================================================================== >--- bin/sh/histedit.c (revision 343334) >+++ bin/sh/histedit.c (working copy) >@@ -472,10 +472,31 @@ > int > bindcmd(int argc, char **argv) > { >+ int ret; >+ FILE *out1, *out2; > > if (el == NULL) > error("line editing is disabled"); >- return (el_parse(el, argc, __DECONST(const char **, argv))); >+ >+ /* Get current FILE pointers */ >+ el_get(el, EL_GETFP, 1, &out1); >+ el_get(el, EL_GETFP, 2, &out2); >+ >+ /* Swap STDIN and STDOUT. >+ * el's stdout is assinged to STDERR and stderr is assinged to STDOUT. >+ * See how el_init(3) is called in histedit function above. >+ * This is a workaround to output `bind` command message to STDOUT. >+ */ >+ el_set(el, EL_SETFP, 2, out1); >+ el_set(el, EL_SETFP, 1, out2); >+ >+ ret = el_parse(el, argc, __DECONST(const char **, argv)); >+ >+ /* Restore FILE pointers */ >+ el_set(el, EL_SETFP, 1, out1); >+ el_set(el, EL_SETFP, 2, out2); >+ >+ return ret; > } > > #else
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 233343
:
199366
|
200904
|
200905
|
201153
| 201348