[Pcre-svn] [1516] code/trunk/pcretest.c: A better fix for th…

トップ ページ
このメッセージを削除
著者: Subversion repository
日付:  
To: pcre-svn
題目: [Pcre-svn] [1516] code/trunk/pcretest.c: A better fix for the Posix with unknown modifier crash in pcretest.
Revision: 1516
          http://vcs.pcre.org/viewvc?view=rev&revision=1516
Author:   ph10
Date:     2015-02-03 18:07:34 +0000 (Tue, 03 Feb 2015)


Log Message:
-----------
A better fix for the Posix with unknown modifier crash in pcretest.

Modified Paths:
--------------
    code/trunk/pcretest.c


Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c    2015-02-03 17:08:54 UTC (rev 1515)
+++ code/trunk/pcretest.c    2015-02-03 18:07:34 UTC (rev 1516)
@@ -3453,7 +3453,7 @@
   pcre_extra *extra = NULL;


#if !defined NOPOSIX /* There are still compilers that require no indent */
- regex_t preg;
+ regex_t preg = { NULL, 0, 0} ;
int do_posix = 0;
#endif

@@ -3906,7 +3906,6 @@

       default:
       fprintf(outfile, "** Unknown modifier '%c'\n", pp[-1]);
-      do_posix = 0; 
       goto SKIP_DATA;
       }
     }
@@ -5644,7 +5643,7 @@
   CONTINUE:


#if !defined NOPOSIX
- if (posix || do_posix) regfree(&preg);
+ if ((posix || do_posix) && preg.re_pcre != 0) regfree(&preg);
#endif

if (re != NULL) new_free(re);