mirror of
https://github.com/nmap/nmap.git
synced 2025-12-17 21:19:01 +00:00
Prevent a null pointer dereference in nse_nsock_get_ssl.
This could be provoked by a script calling nmap.get_ssl_certificate on an unconnected socket.
This commit is contained in:
@@ -709,7 +709,7 @@ SSL *nse_nsock_get_ssl (lua_State *L)
|
|||||||
{
|
{
|
||||||
nse_nsock_udata *nu = check_nsock_udata(L, 1, 0);
|
nse_nsock_udata *nu = check_nsock_udata(L, 1, 0);
|
||||||
|
|
||||||
if (!nsi_checkssl(nu->nsiod))
|
if (nu->nsiod == NULL || !nsi_checkssl(nu->nsiod))
|
||||||
luaL_argerror(L, 1, "not a SSL socket");
|
luaL_argerror(L, 1, "not a SSL socket");
|
||||||
|
|
||||||
return (SSL *) nsi_getssl(nu->nsiod);
|
return (SSL *) nsi_getssl(nu->nsiod);
|
||||||
|
|||||||
Reference in New Issue
Block a user