summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix typo in last commit.millert2019-02-051-2/+2
|
* Avoid an out of bounds read when regcomp() is passed a bad expression.millert2019-02-051-1/+5
| | | | | | | | When an invalid regular expression is passed, seterr() is called which sets p->error to the appropriate error code and sets p->next and p->end to nuls[]. However, p->next is decremented in the default case in p_ere_exp() and p_simp_re() which makes it point to one byte before nuls[]. From FreeBSD. OK tedu@ deraadt@
* Drop a const-bomb on regexec. It's probably not a good idea to remove amartijn2018-07-112-56/+63
| | | | | | const promise when processing it in the regex engine. Minor tweak and OK schwarze@
* fix oob read; form llvm via Vlad Tsyrklevich; ok millert@otto2017-10-301-3/+3
|
* Clarify code by eliminating unused #define's MUSTSEE, MUSTNOTSEE and inliningkrw2016-12-221-6/+3
| | | | | | MUSTEAT. ok tom@
* Adopt relevant part of NetBSD's r1.7 commit to discard unused results of thekrw2016-12-211-2/+2
| | | | | | | expressions generated by the REQUIRE() macro. Thus eliminating from build output 100 lines or so of gcc complaints about "computed but not used". cluebat & ok tom@
* Delete casts to off_t and size_t that are implied by assignmentsguenther2016-09-212-5/+4
| | | | | | | or prototypes. Ditto for some of the char* and void* casts too. verified no change to instructions on ILP32 (i386) and LP64 (amd64) ok natano@ abluhm@ deraadt@ millert@
* Change the way regexec handles REG_STARTEND combined with REG_NOTBOL.martijn2016-05-262-20/+62
| | | | | | | | | | | | | The new code sees this combination as a continuation of string at offset pmatch[0].rm_so, instead of a new string which starts at that offset. This change fixes a search quirk in vi and is needed for upcoming fixes in ed/sed/vi. This new behaviour is also used in gnu regex. Lots of help from schwarze@ Manpage bits by schwarze@ OK schwarze@ and millert@
* KNF with respect to indentation; no code changeschwarze2016-05-251-28/+27
|
* Fix another one-byte buffer underflow (read access only).schwarze2016-05-251-7/+4
| | | | | | | | | | | | This change touches code that only runs when REG_BASIC is given and the regular expression is anchored with [[:<:]] or \< _and_ uses backreferences. Simplify the logic while here, already looking at the previous character if REG_STARTEND and REG_NOTBOL are both in use, in anticipation of martijn@'s upcoming patch which will further improve REG_STARTEND. OK millert@ martijn@ Also tested by Pedro Giffuni (pfg) on FreeBSD.
* Fix a one-byte buffer underflow (read access only).schwarze2016-05-171-4/+4
| | | | | | | | | | This change touches code that only runs when REG_BASIC is given and the regular expression is anchored with ^ _and_ uses backreferences. The segfault could only be triggered when the ^ anchor was inside a leading () subexpression quantified with *. OK martijn@ Patch also proofread by Pedro Giffuni <pfg at FreeBSD dot org>.
* Remove old cruft.zhuk2016-05-041-95/+0
| | | | okay millert@
* for some time now mandoc has not required MLINKS to functionjmc2016-03-301-3/+1
| | | | | | | | | | | | correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
* Remove NULL-checks before free() and needless argument casts.mmcc2015-12-281-5/+3
| | | | ok tb@
* Remove NULL-checks before free() and unnecessary argument casts.mmcc2015-12-281-8/+5
| | | | ok tb@
* Remove NULL-checks before free() and a few related dead assignments.mmcc2015-12-282-6/+4
| | | | ok and valuable input from millert@
* update NAME section to include all documented functions,jmc2015-11-101-3/+3
| | | | | | or otherwise change Dt to reflect the name of an existing function; feedback/ok schwarze
* delete old lint ARGSUSED commentsguenther2015-11-012-5/+2
|
* Avoid .Ns right after .Pf, it's pointless.schwarze2015-09-141-3/+3
| | | | In some cases, do additional cleanup in the immediate vicinity.
* Wrap <langinfo.h> and <regexp.h> so internal calls go direct andguenther2015-09-141-1/+2
| | | | the symbols are weak
* Reduce usage of predefined strings in manpages.bentley2015-02-281-6/+6
| | | | | | | | | | | Predefined strings are not very portable across troff implementations, and they make the source much harder to read. Usually the intended character can be written directly. No output changes, except for two instances where the incorrect escape was used in the first place. tweaks + ok schwarze@
* put back some information what the character classes actually mean;schwarze2014-12-091-2/+5
| | | | | | while here, remove the lie that regex(3) character classes would depend on the locale; ok jmc@
* no more ctype(3);jmc2014-12-091-7/+4
|
* reallocarray() -- a little tricky to reviewderaadt2014-10-181-3/+3
| | | | ok doug millert
* Userland reallocarray() audit.doug2014-10-111-2/+3
| | | | | | | Avoid potential integer overflow in the size argument of malloc() and realloc() by using reallocarray() to avoid unchecked multiplication. ok deraadt@
* use reallocarray(NULL, a, b) instead of malloc(a, b), which gives usderaadt2014-10-091-5/+5
| | | | | proper mult int overflow detection. The existing code already handles malloc failure properly, of course.
* zap trailing whitespace;jmc2014-09-101-3/+3
|
* document \<word\> as being non standardjsg2014-09-101-2/+8
| | | | | from Pedro F. Giffuni in FreeBSD pr 153257 ok millert@ tedu@
* add \<word\> support to regcomp. prompted by renewed interest from jsgtedu2014-09-081-2/+28
| | | | | | because such support is reportedly common and in somewhat wide use. undocumented for now because we don't endorse this. ok jsg millert
* reallocarray for things which are arrays. ok deraadttedu2014-05-061-8/+8
|
* Use consistent phrasing for bitmask flags.guenther2014-01-221-5/+6
| | | | tweaking and ok millert@ jmc@
* obvious .Pa fixes; found with mandocdb(8)schwarze2014-01-211-3/+3
|
* The print() routine here can be passed at least some of the non-charactersguenther2013-11-281-6/+17
| | | | | | | | | | OUT to EOW, making its domain CHAR_MIN...CODEMAX. It makes sense to have pchar() take the same domain and output those non-characters appropriately, so the (unsigned char) cast for isprint() goes in pchar(). Constipate pchar() while we're here, and let print() pass through NUL to it, as it knows how to output it unambiguously. ok otto@ millert@
* unsigned char cast for ctype; ok guentherderaadt2013-11-261-2/+2
|
* more library historyschwarze2013-07-171-4/+13
| | | | | facts checked by sobrado@ style tweaks and ok jmc@
* [[:>:]] anchors the character preceding it to end of word, not thejmc2013-06-051-3/+3
| | | | | | character following it; From: Peter Fraser
* Use the fancy .In macro for includes. From Jan Klemkow. ok jmc schwarzetedu2013-06-051-4/+4
|
* silence some warnings by adding prototypes, casts, and headers astedu2013-04-175-11/+14
| | | | appropriate. in regex, stop using the struct hack for a fixed size array
* don't handle out-of-mem conditions using compiled out asserts (ugh). Fromotto2011-11-071-9/+10
| | | | netbsd; ok deraadt@
* the posix regex mistake is here to stay. ok deraadttedu2010-11-212-16/+2
|
* More delimiters that need quoting inside macros, hunted down by jmc@,schwarze2010-07-151-5/+5
| | | | who asked me to commit because he is just running out of the door.
* if the first call to allocset() fails, the second might deref a NULLotto2008-02-231-1/+4
| | | | | pointer, so add a safety-net. From Gianluigi Tiesi via Torok Edwin. ok chl@ millert@
* add a proper test around allocsetchl2007-10-101-51/+33
| | | | | | | | | | | use a simpler way to allocated memory in allocset, mostly done by replacing malloc/realloc dance, by only one realloc add comments about variables that are not used uninitialized, even if gcc told the contrary another malloc/realloc -> realloc change Work initially started by otto@, and then I joined him ok otto@ ray@
* use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsgderaadt2007-09-021-3/+3
|
* convert to new .Dd format;jmc2007-05-312-4/+4
|
* (char)to{upper,lower}()deraadt2006-03-311-3/+3
|
* zap rcsidespie2005-08-055-37/+5
|
* s/-p1003.1-2003/-p1003.1-2004/gjmc2005-06-051-3/+3
|
* regsub(3) should not be a link to regex(3) as it is not a POSIX regexmillert2005-04-151-3/+2
| | | | routine and is not described in regex(3).
* Be correct in our man pages when talking about NUL termination (that is,cloder2005-02-251-3/+3
| | | | | termination with '\0') vs. null termination. Input from krw@, jaredy@, jmc@. OK deraadt@