Changeset 3234 for trunk/src/kmk


Ignore:
Timestamp:
Oct 28, 2018, 3:12:38 PM (7 years ago)
Author:
bird
Message:

kmk/job.c: Fixed a use-after-free problem in die() when flushing a stale output_context. Make sure free_child() doesn't leave a stale output_context behind.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/job.c

    r3192 r3234  
    11251125  output_close (&child->output);
    11261126
     1127  /* bird: Make sure the output_context doesn't point to a freed structure when
     1128           we return from this function.  This is probably an issue elsewhere
     1129           in the code, however it doesn't cost us much fixing it here.  (The
     1130           access after free was caught in a die() scenario, both in error
     1131           situations and successful ones.)  */
     1132  if (output_context == &child->output)
     1133    OUTPUT_UNSET();
     1134
    11271135  if (!jobserver_tokens)
    11281136    ONS (fatal, NILF, "INTERNAL: Freeing child %p (%s) but no tokens left!\n",
Note: See TracChangeset for help on using the changeset viewer.