No description
  • C 93.6%
  • Assembly 4.4%
  • C++ 1.2%
  • Awk 0.4%
  • Makefile 0.3%
  • Other 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Szabolcs Nagy 7813e9119e regex: avoid int overflow in regcomp
regcomp has many int arith ops that may overflow. before tre_expand_ast
int values are limited by 2x the input length n, e.g.:

  input ERE        int field    max value
  aaaaaaaaaaaa...  position     n
  ()()()()()()...  submatch_id  n/2+1
  ()||||||||||...  num_tags     2n-3

so overflow before expand requires large n (and a lot of memory). later
some values can become big due to repetitions:

  input ERE                     int field that overflows
  (((a{255}){255}){255}){255}   position
  ((a|b*){255,}){255,}          num_transitions

num_transitions and memory use can be big without {k,} repetitions too:

  input ERE        what             max value
  (a|a|a|a...|a)*  num_transitions  n^2/4
  (()|a|a|...|a)*  sum tnfa tags    > n^3/16 - n^2

so memory can run out quickly as n grows (with 31bit va space 1700 long
input is enough even without {k,}) about half is tnfa and half is ast
firstpos/lastpos data. but overflow can happen before allocations fail.

fix early overflow by limiting n. the stack usage is in [n,11n] without
repetitions, usually 7n, so the stack limit got adjusted too. the limit
is such that almost all inputs that worked before still work.

overflows during and after expand are fixed by explicit checks via a
check_add helper and xcalloc instead of xmalloc.
2026-10-14 18:48:56 -04:00
arch riscv: clear fp and ra in _start like on other ports 2026-09-07 20:37:25 -04:00
compat/time32 remove LFS64 symbol aliases; replace with dynamic linker remapping 2022-10-19 14:01:31 -04:00
crt mips: use preferred asm mnemomic jr for better assembler compatibility 2024-10-22 18:58:02 -04:00
dist add another example option to dist/config.mak 2012-04-24 16:49:11 -04:00
include fcntl.h: add new fallocate operation flags 2026-10-12 11:47:57 -04:00
ldso ldso: fix missing errno code when reporting relro mprotect failure 2026-05-05 20:34:14 -04:00
src regex: avoid int overflow in regcomp 2026-10-14 18:48:56 -04:00
tools install.sh: avoid creating symlinks with restricted permissions 2024-02-03 19:57:30 -05:00
.gitignore remove obsolete gitignore rules 2016-07-06 00:21:25 -04:00
.mailmap update contributor name 2019-12-07 12:21:35 -05:00
configure configure: enable riscv32 port 2024-02-29 16:59:06 -05:00
COPYRIGHT update contributor name in authorship notices 2024-10-10 19:44:58 -04:00
dynamic.list fix regression in access to optopt object 2018-11-19 13:20:41 -05:00
INSTALL update INSTALL file archs list with riscv32, loongarch64 additions 2024-02-29 19:23:03 -05:00
Makefile fix missing make dependency for Scrt1.o due to typo 2024-08-09 23:03:52 -04:00
README update version reference in the README file 2014-06-25 14:16:53 -04:00
VERSION release 1.2.6 2026-03-20 11:40:00 -04:00
WHATSNEW release 1.2.6 2026-03-20 11:40:00 -04:00

    musl libc

musl, pronounced like the word "mussel", is an MIT-licensed
implementation of the standard C library targetting the Linux syscall
API, suitable for use in a wide range of deployment environments. musl
offers efficient static and dynamic linking support, lightweight code
and low runtime overhead, strong fail-safe guarantees under correct
usage, and correctness in the sense of standards conformance and
safety. musl is built on the principle that these goals are best
achieved through simple code that is easy to understand and maintain.

The 1.1 release series for musl features coverage for all interfaces
defined in ISO C99 and POSIX 2008 base, along with a number of
non-standardized interfaces for compatibility with Linux, BSD, and
glibc functionality.

For basic installation instructions, see the included INSTALL file.
Information on full musl-targeted compiler toolchains, system
bootstrapping, and Linux distributions built on musl can be found on
the project website:

    http://www.musl-libc.org/