bin/84740: regcomp("\254") fails

Peter Jeremy peterjeremy at
Wed Aug 10 10:30:20 GMT 2005

>Number:         84740
>Category:       bin
>Synopsis:       regcomp("\254") fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 10 10:30:18 GMT 2005
>Originator:     Peter Jeremy
>Release:        FreeBSD 7.0-CURRENT i386
System: FreeBSD 7.0-CURRENT FreeBSD 7.0-CURRENT #1: Mon Aug 8 18:22:06 EST 2005 root at i386

	regcomp(3) fails to compile the string "\376" as an extended RE
	(but does handle it as a BRE) and reports "empty (sub)expression".
	This works correctly on 4.9 but fails on 5.3 and a recent -CURRENT.


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

int main(int argc, char **argv)
    char	buf[1024];
    int		r;
    regex_t	rx;

    r = regcomp(&rx, "\376", REG_EXTENDED);
    if (r != 0) {
	regerror(r, &rx, buf, sizeof(buf));
	printf("%s\n", buf);


More information about the freebsd-bugs mailing list