g10: Fix regexp sanitization.
authorNIIBE Yutaka <gniibe@fsij.org>
Thu, 9 Nov 2017 05:03:22 +0000 (14:03 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Mon, 4 Dec 2017 10:34:43 +0000 (19:34 +0900)
commit9ba0e2c76c0c040e69e50ed9d89eadb3269052f9
tree9e01cae20d189182908329d5d7b15a7501de9623
parent67cd81ed90ad88cbe607b7f7d1a0b1e08b8ac1f1
g10: Fix regexp sanitization.

* g10/trustdb.c (sanitize_regexp): Only escape operators.

--

Backport from master commit:
ccf3ba92087e79abdeaa0208795829b431c6f201

To sanitize a regular expression, quoting by backslash should be only
done for defined characters.  POSIX defines 12 characters including
dot and backslash.

Quoting other characters is wrong, in two ways; It may build an
operator like: \b, \s, \w when using GNU library.  Case ignored match
doesn't work, because quoting lower letter means literally and no
much to upper letter.

GnuPG-bug-id: 2923
Co-authored-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
g10/trustdb.c