]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix an out-of-bounds memory read.
authorBruno Haible <bruno@clisp.org>
Sat, 30 Sep 2017 11:42:24 +0000 (13:42 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 30 Sep 2017 11:42:24 +0000 (13:42 +0200)
Reported by Jakub Wilk <jwilk@jwilk.net>.

* gnulib-local/lib/term-ostream.oo.c (term_ostream_create): Pass the correct
length to memcmp().

gnulib-local/lib/term-ostream.oo.c

index 165fc33eaae0d15da98c0d4e88e89c08f9dcbff6..84d04eb6680c6bee563f5b12e089aed926811e87 100644 (file)
@@ -1877,7 +1877,7 @@ term_ostream_create (int fd, const char *filename)
         && (/* Recognize xterm-16color, xterm-88color, xterm-256color.  */
             (strlen (term) >= 5 && memcmp (term, "xterm", 5) == 0)
             || /* Recognize rxvt-16color.  */
-               (strlen (term) >= 4 && memcmp (term, "rxvt", 7) == 0)
+               (strlen (term) >= 4 && memcmp (term, "rxvt", 4) == 0)
             || /* Recognize konsole-16color.  */
                (strlen (term) >= 7 && memcmp (term, "konsole", 7) == 0))
         ? (stream->max_colors == 256 ? cm_xterm256 :