From: Bruno Haible Date: Wed, 20 Mar 2019 21:31:18 +0000 (+0100) Subject: libtextstyle: Fix a memory access from a signal handler. X-Git-Tag: v0.20~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a9f399e66c78a905705a0ee3d2c171924f6e05b;p=thirdparty%2Fgettext.git libtextstyle: Fix a memory access from a signal handler. * gnulib-local/lib/term-ostream.oo.c (struct term_ostream): Mark active_attr field as volatile. --- diff --git a/gnulib-local/lib/term-ostream.oo.c b/gnulib-local/lib/term-ostream.oo.c index 408e2cf65..364f43b63 100644 --- a/gnulib-local/lib/term-ostream.oo.c +++ b/gnulib-local/lib/term-ostream.oo.c @@ -1203,23 +1203,23 @@ fields: bool volatile same_as_stderr; #endif /* Variable state, representing past output. */ - attributes_t default_attr; /* Default simplified attributes of the - terminal. */ - attributes_t active_attr; /* Simplified attributes that we have set - on the terminal. */ - bool non_default_active; /* True if activate_non_default_attr() - is in effect. - active_attr != default_attr implies - non_default_active == true, - but not the opposite! */ + attributes_t default_attr; /* Default simplified attributes of the + terminal. */ + attributes_t volatile active_attr; /* Simplified attributes that we have set + on the terminal. */ + bool non_default_active; /* True if activate_non_default_attr() + is in effect. + active_attr != default_attr implies + non_default_active == true, + but not the opposite! */ /* Variable state, representing future output. */ - char *buffer; /* Buffer for the current line. */ - attributes_t *attrbuffer; /* Buffer for the simplified attributes; same - length as buffer. */ - size_t buflen; /* Number of bytes stored so far. */ - size_t allocated; /* Allocated size of the buffer. */ - attributes_t curr_attr; /* Current attributes. */ - attributes_t simp_attr; /* Simplified current attributes. */ + char *buffer; /* Buffer for the current line. */ + attributes_t *attrbuffer; /* Buffer for the simplified attributes; + same length as buffer. */ + size_t buflen; /* Number of bytes stored so far. */ + size_t allocated; /* Allocated size of the buffer. */ + attributes_t curr_attr; /* Current attributes. */ + attributes_t simp_attr; /* Simplified current attributes. */ }; /* Simplify attributes, according to the terminal's capabilities. */