libfreerdp-core: fix possible crash on unauthorized TS Gateway error
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Thu, 5 Dec 2013 22:31:33 +0000 (17:31 -0500)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Thu, 5 Dec 2013 22:31:33 +0000 (17:31 -0500)
libfreerdp/core/gateway/rpc.c

index ae024cd..5a3760f 100644 (file)
@@ -360,6 +360,12 @@ int rpc_write(rdpRpc* rpc, BYTE* data, int length, UINT16 opnum)
 
        ntlm = rpc->ntlm;
 
+       if ((!ntlm) || (!ntlm->table))
+       {
+               fprintf(stderr, "rpc_write: invalid ntlm context\n");
+               return -1;
+       }
+
        if (ntlm->table->QueryContextAttributes(&ntlm->context, SECPKG_ATTR_SIZES, &ntlm->ContextSizes) != SEC_E_OK)
        {
                fprintf(stderr, "QueryContextAttributes SECPKG_ATTR_SIZES failure\n");