This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: re_search_2 bug with NULL reference


On Sat, Nov 02, 2002 at 04:52:45PM -0800, Roland McGrath wrote:
> Please isolate what the exact re_* calls are and the regex and match text
> involved, and produce a simple test program that just makes those calls and
> exhibits the crash.

Here is a short test program.

#include <string.h>
#include <regex.h>

int main()
{
        char *rexp="/\\*([^*]|\\*[^/])*\\*/";
        char *buf;
        struct re_pattern_buffer rexp_c;
        struct re_registers regs;
        int bs;

        memset(&rexp_c,0,sizeof(rexp_c));
        memset(&regs,0,sizeof(regs));

        buf="/*a\nb\nc*/\n";
        bs=strlen(buf);

        re_syntax_options=RE_NO_BK_VBAR|RE_NO_BK_PARENS;
        re_compile_pattern(rexp,strlen(rexp),&rexp_c);
        re_search_2(&rexp_c,buf,bs,0,0,0,bs,&regs,bs);

        return 0;
}

-- 
   Alexander.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]