mirror of
https://github.com/FAUSheppy/colorredstderr-mirror
synced 2025-12-11 09:28:33 +01:00
Fix possible memory overwrite in init_from_environment().
It was possible for a user to overwrite memory at a relative location with 1 by passing a negative file descriptor.
This commit is contained in:
@@ -135,7 +135,10 @@ static void init_from_environment(void) {
|
||||
*x = 0;
|
||||
|
||||
int fd = atoi(last);
|
||||
if (fd < TRACKFDS_STATIC_COUNT) {
|
||||
if (fd < 0) {
|
||||
goto next;
|
||||
|
||||
} else if (fd < TRACKFDS_STATIC_COUNT) {
|
||||
tracked_fds[fd] = 1;
|
||||
} else {
|
||||
if (!tracked_fds_list) {
|
||||
|
||||
Reference in New Issue
Block a user