pike.git / src / modules / Regexp / pike_regexp.c

version» Context lines:

pike.git/src/modules/Regexp/pike_regexp.c:303:    /* First pass: determine size, legality. */    regparse = exp2;    regnpar = 1;    regsize = 0L;    regcode = &regdummy;    if (reg(0, &flags) == NULL)    goto exit_regcomp;       /* Small enough for pointer-storage convention? */    if (regsize >= 32767L) /* Probably could be 65535L. */ -  goto exit_regcomp; +  { +  free(exp2); +  FAIL("regexp too big"); +  }       /* Allocate space. */    r = malloc(sizeof(regexp) + (unsigned) regsize);    if(!r)    {    free(exp2);    Pike_error(msg_out_of_mem);    }       /* Second pass: emit code. */