diff options
author | rillig <rillig@pkgsrc.org> | 2020-03-17 17:09:48 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2020-03-17 17:09:48 +0000 |
commit | a0a311852cf21834c57fbd4f668187685e98059a (patch) | |
tree | fa70fb2d325d907a6a234a476a01484103a17e80 /shells | |
parent | ef733df2bdaf907b0c3f1dea76995c4f0189f3e2 (diff) | |
download | pkgsrc-a0a311852cf21834c57fbd4f668187685e98059a.tar.gz |
shells/bash: fix array subscript with char
Diffstat (limited to 'shells')
-rw-r--r-- | shells/bash/distinfo | 5 | ||||
-rw-r--r-- | shells/bash/patches/patch-bashline.c | 15 | ||||
-rw-r--r-- | shells/bash/patches/patch-lib_malloc_malloc.c | 15 | ||||
-rw-r--r-- | shells/bash/patches/patch-subst.c | 15 |
4 files changed, 49 insertions, 1 deletions
diff --git a/shells/bash/distinfo b/shells/bash/distinfo index 52c5327f738..239d4d58141 100644 --- a/shells/bash/distinfo +++ b/shells/bash/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.57 2020/02/11 11:45:25 kre Exp $ +$NetBSD: distinfo,v 1.58 2020/03/17 17:09:48 rillig Exp $ SHA1 (bash-5.0.tar.gz) = d116b469b9e6ea5264a74661d3a4c797da7f997b RMD160 (bash-5.0.tar.gz) = a081428a896d617855499376b670eca3433a27c1 @@ -71,10 +71,13 @@ Size (bash50-016) = 1534 bytes SHA1 (patch-af) = e26e3209902247263884cfebc11a2f7e43245062 SHA1 (patch-ag) = cd3b151e3bb045d2bb609c0a03d7d3df2c871f47 SHA1 (patch-aj) = 2e4c15afd9b50d44967ee8e1f85bdc908c0eeeb0 +SHA1 (patch-bashline.c) = 812de2510f3eca741bfee38bad14bcaa8091681e SHA1 (patch-builtins_ulimit.def) = 1390069344607204eb3abbd6ddeb148ff590c55e SHA1 (patch-configure) = c4e1ab53a1ee85f3e6121047f0aca8ceb85e6e5d SHA1 (patch-examples_loadables_fdflags.c) = 92a63c8f4c94ccf9cf782e934a0806930d172654 SHA1 (patch-examples_loadables_push.c) = 57a3c7de9ea0a75c373db678d9500954bcf40ff4 +SHA1 (patch-lib_malloc_malloc.c) = 83e93dfa6b65de77878425f8dff51ecb53085323 SHA1 (patch-shell.c) = daa07914d4c318cd72463f80344f4f7c364809cd +SHA1 (patch-subst.c) = b0dccd5dc96c19eba1dd160e4def0f9291ce06e1 SHA1 (patch-support_shobj-conf) = 8750c104549ea8a4a722bd21a684a9fe13e05fe5 SHA1 (patch-variables.c) = 8d91272602aba348dc158d8fb5948edd90d96646 diff --git a/shells/bash/patches/patch-bashline.c b/shells/bash/patches/patch-bashline.c new file mode 100644 index 00000000000..681fb7b5972 --- /dev/null +++ b/shells/bash/patches/patch-bashline.c @@ -0,0 +1,15 @@ +$NetBSD: patch-bashline.c,v 1.1 2020/03/17 17:09:48 rillig Exp $ + +Fix array subscript with char index. + +--- bashline.c.orig 2020-03-17 16:57:19.058552795 +0000 ++++ bashline.c +@@ -4050,7 +4050,7 @@ set_filename_bstab (string) + + memset (filename_bstab, 0, sizeof (filename_bstab)); + for (s = string; s && *s; s++) +- filename_bstab[*s] = 1; ++ filename_bstab[(unsigned char) *s] = 1; + } + + /* Quote a filename using double quotes, single quotes, or backslashes diff --git a/shells/bash/patches/patch-lib_malloc_malloc.c b/shells/bash/patches/patch-lib_malloc_malloc.c new file mode 100644 index 00000000000..d12ce086424 --- /dev/null +++ b/shells/bash/patches/patch-lib_malloc_malloc.c @@ -0,0 +1,15 @@ +$NetBSD: patch-lib_malloc_malloc.c,v 1.1 2020/03/17 17:09:48 rillig Exp $ + +Fix array subscript with char index. + +--- lib/malloc/malloc.c.orig 2018-06-20 13:55:09.000000000 +0000 ++++ lib/malloc/malloc.c +@@ -266,7 +266,7 @@ static const unsigned long binsizes[NBUC + }; + + /* binsizes[x] == (1 << ((x) + 3)) */ +-#define binsize(x) binsizes[(x)] ++#define binsize(x) binsizes[(size_t) (x)] + + #if !defined (errno) + extern int errno; diff --git a/shells/bash/patches/patch-subst.c b/shells/bash/patches/patch-subst.c new file mode 100644 index 00000000000..f14f50c1f28 --- /dev/null +++ b/shells/bash/patches/patch-subst.c @@ -0,0 +1,15 @@ +$NetBSD: patch-subst.c,v 1.1 2020/03/17 17:09:48 rillig Exp $ + +Fix array subscript with char index. + +--- subst.c.orig 2020-03-17 16:57:17.469764555 +0000 ++++ subst.c +@@ -11294,7 +11294,7 @@ shell_expand_word_list (tlist, eflags) + case 'l': + case 'u': + case 'c': +- omap[l->word->word[oind]] = 1; ++ omap[(unsigned char) l->word->word[oind]] = 1; + if (opti == 0) + opts[opti++] = '-'; + break; |