Author: dmiller
Date: Tue Jul 15 11:22:27 2025
New Revision: 39251
Log:
Avoid dereferencing freed pointer
Modified:
nmap/nse_libssh2.cc
Modified: nmap/nse_libssh2.cc
==============================================================================
--- nmap/nse_libssh2.cc (original)
+++ nmap/nse_libssh2.cc Tue Jul 15 11:22:27 2025
@@ -850,6 +850,7 @@
static int channel_request (lua_State *L, int status, lua_KContext ctx) {
int rc;
request_context *req_ctx = (request_context *)ctx;
+ const char* request_str = req_ctx->request;
DO_OR_YIELD((rc = libssh2_channel_process_startup(req_ctx->channel,
req_ctx->request, req_ctx->request_len,
@@ -859,7 +860,7 @@
free(req_ctx);
if (rc != 0)
- return luaL_error(L, "Error sending %s request", req_ctx->request);
+ return luaL_error(L, "Error sending %s request", request_str);
return 0;
}
_______________________________________________
Sent through the svn mailing list
https://nmap.org/mailman/listinfo/svn