New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signal handler should not call malloc/free #190
Comments
CUPS.org User: mike Fixed in CVS for the next releases. Patch attached. |
"str190.patch": Index: cupsd.hRCS file: /development/cvs/cups/scheduler/cupsd.h,v -VAR int NeedReload VALUE(RELOAD_ALL);
Index: log.cRCS file: /development/cvs/cups/scheduler/log.c,v
-int /* O - 1 on success, 0 on error /
/* va_start(ap, message);
/*
if (len > 0 && line[len - 1] != '\n')
cupsFileFlush(ErrorFile); @@ -371,10 +408,10 @@ /*
/* Index: main.cRCS file: /development/cvs/cups/scheduler/main.c,v static int parent_signal = 0; /* Set to signal number from child / /*
@@ -1000,6 +1006,12 @@
@@ -1035,6 +1047,12 @@ (void)sig; /* remove compiler warnings... */
/*
|
Version: 1.1.19
CUPS.org User: mike
The SIGCHLD handler calls LogMessage which calls cupsFileOpen/Close to rotate the log files. This can cause heap corruption since malloc/free are not safe to call from a signal handler.
Need to add a global to prevent LogMessage and friends from rotating the log files when called from the signal handlers.
The text was updated successfully, but these errors were encountered: