hangup paranoia (trunk only)
If nhwindows_hangup() were to get called a second time, it would have
saved hup_exit_nhwindows() as the previous interface's shutdown routine.
Then if/when exit_nhwindows() gets called, hup_exit_nhwindows() would
have called itself with uncontrolled recursion. So guard against that by
preventing the hangup shutdown routine from ever being saved as previous
interface shutdown routine.
Also, avoid the exit_windows macro when using it as a pointer rather
than for a function call, since pre-ANSI compilers might be confused by
its expansion.
This commit is contained in:
+3
-2
@@ -313,8 +313,9 @@ nhwindows_hangup()
|
|||||||
/* don't call exit_nhwindows() directly here; if a hangup occurs
|
/* don't call exit_nhwindows() directly here; if a hangup occurs
|
||||||
while interface code is executing, exit_nhwindows could knock
|
while interface code is executing, exit_nhwindows could knock
|
||||||
the interface's active data structures out from under itself */
|
the interface's active data structures out from under itself */
|
||||||
if (iflags.window_inited)
|
if (iflags.window_inited &&
|
||||||
previnterface_exit_nhwindows = exit_nhwindows;
|
windowprocs.win_exit_nhwindows != hup_exit_nhwindows)
|
||||||
|
previnterface_exit_nhwindows = windowprocs.win_exit_nhwindows;
|
||||||
windowprocs = hup_procs;
|
windowprocs = hup_procs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user