aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-06 20:55:56 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-06 20:55:56 +0200
commit184c738582eb190489dd2e9d120b1e036df65401 (patch)
treec12ad562b1ecff416ed4bc48e0ccb4c1a0fc35c1 /coreutils
parent035e71578e98744acba2394bb03686d08f60d956 (diff)
downloadbusybox-w32-184c738582eb190489dd2e9d120b1e036df65401.tar.gz
busybox-w32-184c738582eb190489dd2e9d120b1e036df65401.tar.bz2
busybox-w32-184c738582eb190489dd2e9d120b1e036df65401.zip
stty: fix bb_common_bufsiz1 use in NOEXEC
function old new delta stty_main 1211 1221 +10 do_display 379 370 -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/stty.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c
index d09f0e453..2292fa5ee 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -782,12 +782,12 @@ struct globals {
782 unsigned max_col; 782 unsigned max_col;
783 /* Current position, to know when to wrap */ 783 /* Current position, to know when to wrap */
784 unsigned current_col; 784 unsigned current_col;
785 char buf[10];
786} FIX_ALIASING; 785} FIX_ALIASING;
787#define G (*(struct globals*)bb_common_bufsiz1) 786#define G (*(struct globals*)bb_common_bufsiz1)
788#define INIT_G() do { \ 787#define INIT_G() do { \
789 G.device_name = bb_msg_standard_input; \ 788 G.device_name = bb_msg_standard_input; \
790 G.max_col = 80; \ 789 G.max_col = 80; \
790 G.current_col = 0; /* we are noexec, must clear */ \
791} while (0) 791} while (0)
792 792
793static void set_speed_or_die(enum speed_setting type, const char *arg, 793static void set_speed_or_die(enum speed_setting type, const char *arg,
@@ -1018,6 +1018,8 @@ static void do_display(const struct termios *mode, int all)
1018 1018
1019 for (i = 0; i != CIDX_min; ++i) { 1019 for (i = 0; i != CIDX_min; ++i) {
1020 char ch; 1020 char ch;
1021 char buf10[10];
1022
1021 /* If swtch is the same as susp, don't print both */ 1023 /* If swtch is the same as susp, don't print both */
1022#if VSWTCH == VSUSP 1024#if VSWTCH == VSUSP
1023 if (i == CIDX_swtch) 1025 if (i == CIDX_swtch)
@@ -1033,10 +1035,10 @@ static void do_display(const struct termios *mode, int all)
1033#endif 1035#endif
1034 ch = mode->c_cc[control_info[i].offset]; 1036 ch = mode->c_cc[control_info[i].offset];
1035 if (ch == _POSIX_VDISABLE) 1037 if (ch == _POSIX_VDISABLE)
1036 strcpy(G.buf, "<undef>"); 1038 strcpy(buf10, "<undef>");
1037 else 1039 else
1038 visible(ch, G.buf, 0); 1040 visible(ch, buf10, 0);
1039 wrapf("%s = %s;", nth_string(control_name, i), G.buf); 1041 wrapf("%s = %s;", nth_string(control_name, i), buf10);
1040 } 1042 }
1041#if VEOF == VMIN 1043#if VEOF == VMIN
1042 if ((mode->c_lflag & ICANON) == 0) 1044 if ((mode->c_lflag & ICANON) == 0)