Package: libc6
Version: 2.3.1-3
Severity: normal

Compiling the following program with:

  gcc -o regex -Wall -lefence regex.c

it segfaults when run, but it's OK when efence isn't used. Changing the
expression or the test string (eg to just the first line) sometimes stops the
crashes, depending on what they're changed to.

#include <stdio.h>
#include <regex.h>

const char *expression = "Newsgroups: uk.finance";
const char *test = "Subject: Re: second opinion?\n"
    "From: \"hugh pearce\" <[EMAIL PROTECTED]>\n"
    "Date: Sat, 26 Oct 2002 17:51:54 +0100\n"
    "Message-ID: <apeh6d$qlk6$[EMAIL PROTECTED]>\n"
    "References: <apdoep$fot$[EMAIL PROTECTED]>\n"
    "Size: 1280\n"
    "Lines: 26\n"
    "Newsgroups: uk.comp.homebuilt\n";

int main()
{
    regex_t reg;
    int errcode;

    if ((errcode = regcomp(&reg, expression,
            REG_EXTENDED | REG_NEWLINE | REG_NOSUB | REG_ICASE)) != 0)
    {
        static char score_regexerr[256];

        regerror(errcode, &reg, score_regexerr, 256);
        return 0;
    }
    if (regexec(&reg, test, 0, NULL, 0))
    {
        printf("No match\n");
    }
    else
    {
        printf("Match\n");
    }
    return 0;
}

FWIW: gcc version 2.95.4 20011002 (Debian prerelease)

-- System Information
Debian Release: testing/unstable
Kernel Version: Linux realh 2.4.19-th #2 Wed Oct 9 01:06:39 BST 2002 i686 AMD 
Athlon(tm) Processor AuthenticAMD GNU/Linux

Versions of the packages libc6 depends on:
ii  libdb1-compat  2.1.3-6        The Berkeley database routines [glibc 2.0/2.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to