Skip to content

Commit

Permalink
AP_Scripting: prevent re-use of closed socket
Browse files Browse the repository at this point in the history
this prevents a null pointer dereference after a close of a network
socket
  • Loading branch information
tridge committed Feb 13, 2024
1 parent 8491356 commit 7b36adf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libraries/AP_Scripting/lua_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@ int SocketAPM_close(lua_State *L) {
ud->close();
delete ud;
scripting->_net_sockets[i] = nullptr;
*check_SocketAPM(L, 1) = nullptr;
break;
}
}
Expand Down

0 comments on commit 7b36adf

Please sign in to comment.