Change #274908
| Category | wget |
| Changed by | Michal Ruprich <michalruprich@gmail.com> |
| Changed at | Tue 14 Jul 2026 21:43:32 |
| Repository | https://gitlab.com/gnuwget/wget.git |
| Project | wget |
| Branch | master |
| Revision | e1f2559efad5e2733ded804f9f1ba8acd8c4de61 |
Comments
Moving async signal unsafe functions out of signal handler There is a very rare race condition in function redirect_output_signal(). If SIGHUP is received while wget is in malloc() function and a new logfile is opened with fopen, another malloc() is called. malloc() is not an async signal safe function and should not be called from within a signal handler. * src/main.c (redirect_output_signal): do not call redirect_output(), add an atomic flag. * src/log.c (check_redirect_output): move redirect_output() here since this is not in a signal handler Copyright-paperwork-exempt: Yes
Changed files
- src/log.c
- src/main.c