mirror of
https://git.musl-libc.org/git/musl
synced 2026-11-13 18:16:53 -06:00
No description
- C 93.6%
- Assembly 4.4%
- C++ 1.2%
- Awk 0.4%
- Makefile 0.3%
- Other 0.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
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.
|
||
| arch | ||
| compat/time32 | ||
| crt | ||
| dist | ||
| include | ||
| ldso | ||
| src | ||
| tools | ||
| .gitignore | ||
| .mailmap | ||
| configure | ||
| COPYRIGHT | ||
| dynamic.list | ||
| INSTALL | ||
| Makefile | ||
| README | ||
| VERSION | ||
| WHATSNEW | ||
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/