History log of /netbsd-src/lib/libc/regex/regcomp.c (Results 1 – 25 of 49)
Revision Date Author Comments
# 3896c310 01-Jan-2025 christos <christos@NetBSD.org>

PR/58910: enh at google dot com: Fix signed character issue in character
ranges.


# d5c6fca1 30-Aug-2023 christos <christos@NetBSD.org>

- cast GETNEXT to unsigned where it is being promoted to int to prevent
sign-extension (really it would have been better for PEEK*() and GETNEXT()
to return unsigned char; this would have removed

- cast GETNEXT to unsigned where it is being promoted to int to prevent
sign-extension (really it would have been better for PEEK*() and GETNEXT()
to return unsigned char; this would have removed a ton of (uch) casts, but
it is too intrusive for now).
- fix an isalpha that should have been iswalpha

show more ...


# eb7b4f77 21-Dec-2022 wiz <wiz@NetBSD.org>

Remove unneeded -D_OPENBSD_SOURCE


# 259eea82 11-Mar-2021 christos <christos@NetBSD.org>

recognize the "C" language backslash escapes like gnu does (except b which
is already taken)


# f09b3194 26-Feb-2021 christos <christos@NetBSD.org>

Arrange for tools build


# 67f076ea 25-Feb-2021 christos <christos@NetBSD.org>

add missing _


# 6bde3cc4 25-Feb-2021 christos <christos@NetBSD.org>

fix NLS compilation


# e37fce91 25-Feb-2021 christos <christos@NetBSD.org>

Add glue to disable locale code in order to be smaller.


# ccd77ba5 25-Feb-2021 christos <christos@NetBSD.org>

protect MIN from re-definition


# 2cf99de6 24-Feb-2021 christos <christos@NetBSD.org>

reduce casts


# 1ee269c3 23-Feb-2021 christos <christos@NetBSD.org>

sync with FreeBSD:
- NLS support
- GNU extensions
- bug fixes


# b0735e41 07-Feb-2019 christos <christos@NetBSD.org>

Add some better error handling from FreeBSD, although we don't
suffer from the same issue, since we don't decrement p->next, like
FreeBSD does because we don't have multibyte support (yet). We
choose

Add some better error handling from FreeBSD, although we don't
suffer from the same issue, since we don't decrement p->next, like
FreeBSD does because we don't have multibyte support (yet). We
choose to do this so we can fail faster and more predictably.

Here's the original FreeBSD message:

When passed the invalid regular expression "a**", the error is
eventually detected and seterr() is called. It sets p->error
appropriatly and p->next and p->end to nuls which is a never used char
nuls[10] which is zeros due to .bss initialization. Unfortunatly,
p_ere_exp() and p_simp_re() both have fall through cases where they set
the error, decrement p->next and access it which means a read from what
ever .bss variable comes before nuls.

Found with regex_test:repet_multi and CHERI bounds checking.

Reviewed by: ngie, pfg, emaste
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D10541

show more ...


# 2ebb8fd3 07-Feb-2019 christos <christos@NetBSD.org>

Fix OOB read from FreeBSD:

The bug is an out-of-bounds read detected with address sanitizer that
happens when 'sp' in p_b_coll_elems() includes NUL byte[s], e.g. if it's
equal to "GS\x00". In that c

Fix OOB read from FreeBSD:

The bug is an out-of-bounds read detected with address sanitizer that
happens when 'sp' in p_b_coll_elems() includes NUL byte[s], e.g. if it's
equal to "GS\x00". In that case len will be equal to 4, and the
strncmp(cp->name, sp, len) call will succeed when cp->name is "GS" but the
cp->name[len] == '\0' comparison will cause the read to go out-of-bounds.

Checking the length using strlen() instead eliminates the issue.

The bug was found in LLVM with oss-fuzz:
https://reviews.llvm.org/D39380

show more ...


# aa52694f 12-Sep-2015 christos <christos@NetBSD.org>

use the unsigned char version of the input char in all cases "cap[uc]" to
avoid accessing cap[negative], found by Elliott Hughes


# f6072d06 17-Feb-2015 joerg <joerg@NetBSD.org>

Use reallocarr and simplify. Document valid reallocation failures.


# a582ce59 05-Feb-2015 christos <christos@NetBSD.org>

Add and use reallocarray() to prevent a multiplication overflow in allocation.
Reported by Guido Vranken, thanks!


# c5e820ca 13-Mar-2012 christos <christos@NetBSD.org>

PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values t

PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@

show more ...


# c8e7a7ee 08-Nov-2011 christos <christos@NetBSD.org>

if we don't have any sets yet, don't try to look in them.


# 627cbe00 09-Oct-2011 christos <christos@NetBSD.org>

pass lint on i386


# 407d8594 09-Oct-2011 christos <christos@NetBSD.org>

Prevent regcomp/regexec DoS attacks by limiting the amount of memory used
and the level of recursion. Thanks to Maksymilian Arciemowicz for discovery
and help with the implementation.


# 64d3d6de 12-Feb-2009 lukem <lukem@NetBSD.org>

sign-compare fixes


# 931a89e7 09-Feb-2007 junyoung <junyoung@NetBSD.org>

Rearrange headers for better portability.


# 9641e3f0 08-Feb-2007 junyoung <junyoung@NetBSD.org>

ANSIfy.


# 19690e9a 08-Feb-2007 junyoung <junyoung@NetBSD.org>

Nuke __P.


# dcd8e4c8 19-Mar-2006 christos <christos@NetBSD.org>

remove unused label.


12