comparison lib/regex-quote.c @ 37166:fe129ca366e4

regex-quote: fix buffer access out of bounds http://lists.gnu.org/archive/html/bug-gnulib/2013-09/msg00001.html * lib/regex-quote.c (regex_quote_spec_pcre): Fix typo that resulted in an out-of-bounds read.
author Anton Ovchinnikov <revolver112@gmail.com>
date Wed, 04 Sep 2013 17:09:39 -0700
parents c741bc27922a
children 344018b6e5d7
comparison
equal deleted inserted replaced
37165:46132d5e6afa 37166:fe129ca366e4
102 { 102 {
103 struct regex_quote_spec result; 103 struct regex_quote_spec result;
104 char *p; 104 char *p;
105 105
106 p = result.special; 106 p = result.special;
107 memcpy (p, bre_special, sizeof (pcre_special) - 1); 107 memcpy (p, pcre_special, sizeof (pcre_special) - 1);
108 p += sizeof (pcre_special) - 1; 108 p += sizeof (pcre_special) - 1;
109 if (options & PCRE_EXTENDED) 109 if (options & PCRE_EXTENDED)
110 { 110 {
111 *p++ = ' '; 111 *p++ = ' ';
112 *p++ = '\t'; 112 *p++ = '\t';