Details
Details
- Reviewers
dim emaste markj - Commits
- rG7cfffe25da3f: rtld: check for overflow in parse_integer()
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
| libexec/rtld-elf/rtld.c | ||
|---|---|---|
| 6507 | Can we use the stdckint.h routines instead? There is no libc dependency there. | |
| libexec/rtld-elf/rtld.c | ||
|---|---|---|
| 6507 |
You can also avoid the need for wrapping, and avoid unsigned ints, like so: if (n > INT_MAX / 10) return (-1); n *= 10; if (n > INT_MAX - (c - '\0')) return (-1); n += (c - '\0'); No need for stdckint.h then, either. | |