Don't allow the debug subsystem to be initialized twice.
Otherwise we can exhuast our stack when built in static mode.
This commit is contained in:
@@ -130,6 +130,10 @@ int sudo_debug_init(const char *debugfile, const char *settings)
|
||||
char *buf, *cp, *subsys, *pri;
|
||||
int i, j;
|
||||
|
||||
/* Make sure we are not already initialized. */
|
||||
if (sudo_debug_mode != SUDO_DEBUG_MODE_DISABLED)
|
||||
return 1;
|
||||
|
||||
/* Init per-subsystems settings to -1 since 0 is a valid priority. */
|
||||
for (i = 0; i < NUM_SUBSYSTEMS; i++)
|
||||
sudo_debug_settings[i] = -1;
|
||||
|
Reference in New Issue
Block a user