regcomp failure

Philip Blundell Philip.Blundell@pobox.com
Fri Dec 13 11:09:00 GMT 2002


This test program appears to consume all memory and eventually crash
when run with the latest libc from cvs.

p.

--

#include <error.h>
#include <sys/types.h>
#include <regex.h>
#include <stdio.h>
#include <stdlib.h>

int
main (void)
{
  regex_t re;
  regmatch_t ma[2];
  int reerr;
  int res = 0;

  reerr = regcomp (&re, "^6?3?[25]?5?[14]*[25]*[69]*+[58]*87?4?$",REG_EXTENDED | REG_NOSUB);
  if (reerr != 0)
    {
      char buf[100];
      regerror (reerr, &re, buf, sizeof buf);
      error (EXIT_FAILURE, 0, buf);
    }

  exit (0);
}



More information about the Libc-hacker mailing list