diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2017-02-22 17:17:49 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2017-02-22 17:17:49 +0000 |
commit | 7204e99eb2643d5acca173279166b872bccbcb31 (patch) | |
tree | a29d27fd94fa76971b0d932465558792a4ceee48 | |
parent | 058f6242671bed119591362418f2473d6b32df25 (diff) | |
download | pcre-7204e99eb2643d5acca173279166b872bccbcb31.tar.gz |
Avoid use of a potentially overflowing buffer in pcregrep.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1684 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | pcregrep.c | 8 |
2 files changed, 8 insertions, 3 deletions
@@ -20,6 +20,9 @@ several lines after the start. 4. A (?# style comment is now ignored between a basic quantifier and a following '+' or '?' (example: /X+(?#comment)?Y/. +5. Avoid use of a potentially overflowing buffer in pcregrep (patch by Petr +Pisar). + Version 8.40 11-January-2017 ---------------------------- @@ -3190,9 +3190,11 @@ for (j = 1, cp = patterns; cp != NULL; j++, cp = cp->next) cp->hint = pcre_study(cp->compiled, study_options, &error); if (error != NULL) { - char s[16]; - if (patterns->next == NULL) s[0] = 0; else sprintf(s, " number %d", j); - fprintf(stderr, "pcregrep: Error while studying regex%s: %s\n", s, error); + if (patterns->next == NULL) + fprintf(stderr, "pcregrep: Error while studying regex: %s\n", error); + else + fprintf(stderr, "pcregrep: Error while studying regex number %d: %s\n", + j, error); goto EXIT2; } #ifdef SUPPORT_PCREGREP_JIT |