From 89312d65ae3e19bb940d5a79819c7db9444c15aa Mon Sep 17 00:00:00 2001 From: millert Date: Wed, 13 Dec 2017 16:07:54 +0000 Subject: [PATCH] Fix array index by signed char; from martijn@ --- usr.bin/sed/compile.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c index cef3fddbbe7..f01e8f2d911 100644 --- a/usr.bin/sed/compile.c +++ b/usr.bin/sed/compile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compile.c,v 1.46 2017/12/13 16:06:34 millert Exp $ */ +/* $OpenBSD: compile.c,v 1.47 2017/12/13 16:07:54 millert Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. @@ -639,7 +639,6 @@ compile_tr(char *old, char **transtab) else if (*old != delimiter && *old != '\\') error(COMPILE, "Unexpected character after " "backslash"); - } if (*new == '\\') { new++; @@ -649,9 +648,9 @@ compile_tr(char *old, char **transtab) error(COMPILE, "Unexpected character after " "backslash"); } - if (check[*old] == 1) + if (check[(u_char) *old] == 1) error(COMPILE, "Repeated character in source string"); - check[*old] = 1; + check[(u_char) *old] = 1; (*transtab)[(u_char) *old++] = *new++; } if (*old != '\0' || *new != '\0') -- 2.20.1