Skip to content

Commit

Permalink
[LibOS] Set file handle to NULL after each shebang search iteration
Browse files Browse the repository at this point in the history
Otherwise, this could lead to a "double `put_handle()`" problem when
the shebang script depth exceeded the limit.

Signed-off-by: Kailun Qin <kailun.qin@intel.com>
  • Loading branch information
kailun-qin authored and dimakuv committed Sep 19, 2023
1 parent 9f80c42 commit 3c10e21
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libos/src/libos_rtld.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ int load_and_check_exec(const char* path, const char* const* argv, struct libos_
free(*curr_argv);
free(curr_argv);
put_handle(file);
file = NULL;

curr_argv = new_argv;
}
Expand Down

0 comments on commit 3c10e21

Please sign in to comment.