Skip to content

Commit

Permalink
TgBot++: android_builder: Fix stack-use-after-return
Browse files Browse the repository at this point in the history
  • Loading branch information
Royna2544 committed Jul 6, 2024
1 parent 2b826c8 commit 824b4f4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/android_builder/ForkAndRun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ bool ForkAndRun::execute() {
Py_DECREF(os);

// Clear handlers
signal(SIGINT, [](int){});
signal(SIGTERM, [](int){});
signal(SIGINT, [](int) {});
signal(SIGTERM, [](int) {});

int ret = runFunction() ? EXIT_SUCCESS : EXIT_FAILURE;
absl::RemoveLogSink(&sink);
Expand All @@ -63,8 +63,7 @@ bool ForkAndRun::execute() {
random_return_type token = RandomNumberGenerator::generate(100);
auto tregi = OnTerminateRegistrar::getInstance();

tregi->registerCallback(
[this](int sig) { cancel(); }, token);
tregi->registerCallback([this](int sig) { cancel(); }, token);

childProcessId = pid;
close(stdout_pipe.writeEnd());
Expand Down Expand Up @@ -98,7 +97,7 @@ bool ForkAndRun::execute() {
Selector::Mode::READ);
selector.add(
python_pipe.readEnd(),
[&python_pipe] {
[python_pipe] {
BufferType buf{};
ssize_t bytes_read =
read(python_pipe.readEnd(), buf.data(), buf.size() - 1);
Expand Down

0 comments on commit 824b4f4

Please sign in to comment.