Thanks to Andrew Bartlett's advice, fix the NTLMSSP version problem the correct way.
[kai/samba.git] / libcli / auth / msrpc_parse.c
index 336611d132eaa9028f947f983650bbcb40b7778c..7ac6fb57b2dc0f28130cbc597bc18adc794914fe 100644 (file)
@@ -174,7 +174,10 @@ bool msrpc_gen(TALLOC_CTX *mem_ctx,
                        break;
                case 'b':
                        n = pointers[i].length;
-                       memcpy(blob->data + head_ofs, pointers[i].data, n);
+                       if (pointers[i].data && n) {
+                               /* don't follow null pointers... */
+                               memcpy(blob->data + head_ofs, pointers[i].data, n);
+                       }
                        head_ofs += n;
                        break;
                case 'C':