Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 628829 Details for
Bug 866520
pcre_exec() segfaults when back-tracking Unicode properties in non-UTF-8 mode
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
preg.c
preg.c (text/plain), 2.00 KB, created by
Remi Collet
on 2012-10-17 14:00:59 UTC
(
hide
)
Description:
preg.c
Filename:
MIME Type:
Creator:
Remi Collet
Created:
2012-10-17 14:00:59 UTC
Size:
2.00 KB
patch
obsolete
>#include <stdio.h> >#include <string.h> >#include <pcre.h> > >int main (int argc, char *argv[]) { > char *regex = "(?<!\\<)(?<!\\w)(\\pL*foobar\\pL*)(?!\\w|[^<>]*>)"; > char *repl = "<span class='search-everything-highlight-color' style='background-color:#FFF984'>$1</span>"; > char *subj = "foobar – a – 00 aaźaaier"; > pcre *re = NULL; > pcre_extra extra; > const char *error; > int erroffset; > unsigned const char *tables = NULL; > char rc; > int num_subpats; /* Number of captured subpatterns */ > char **subpat_names; /* Array for named subpatterns */ > int name_cnt = 0; > int start_offset; /* Where the new search starts */ > int offsets[99]; > int i, count = 0; /* Count of matched subpatterns */ > int backref; /* Backreference number */ > char *walk; > > printf("regex(%d): %s\n", strlen(regex), regex); > printf("replace(%d): %s\n", strlen(repl), repl); > printf("subj(%d): %s\n", strlen(subj), subj); > tables = pcre_maketables(); > re = pcre_compile(regex, PCRE_CASELESS, &error, &erroffset, NULL); > if (re == NULL) { > printf("Compilation failed: %s at offset %d\n", error, erroffset); > exit(1); > } > extra.flags = 0; > rc = pcre_fullinfo(re, &extra, PCRE_INFO_CAPTURECOUNT, &num_subpats); > if (rc < 0) { > printf("Internal pcre_fullinfo() error %d\n", rc); > exit(1); > } > printf("num_subpat:%d\n", num_subpats); > rc = pcre_fullinfo(re, &extra, PCRE_INFO_NAMECOUNT, &name_cnt); > if (rc < 0) { > printf("Internal pcre_fullinfo() error %d\n", rc); > exit(1); > } > printf("name_cnt:%d\n", name_cnt); > > start_offset = 0; > count = pcre_exec(re, &extra, subj, strlen(subj), start_offset, > 0, offsets, 99); > > printf("start:%d, count:%d\n", start_offset, count); > for (i=0 ; i<(count*2) ; i++) { > printf("offsets[%d]=%d\n", i, offsets[i]); > } > > start_offset = 6; > count = pcre_exec(re, &extra, subj, strlen(subj), start_offset, > 0, offsets, 99); > > printf("start:%d, count:%d\n", start_offset, count); > for (i=0 ; i<(count*2) ; i++) { > printf("offsets[%d]=%d\n", i, offsets[i]); > } > > > return 0; >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 866520
:
627475
| 628829 |
629315
|
630005