Merge master-branch

* master:
  Correctly NUL-terminate log buffer
  tcmalloc: Only include tcmalloc tests if active allocator

Change-Id: I7b6e24c05f0673c91fbfe07a7108f4f38c04273f
MB-11501: Client may cause server to crash in SASL

A client skipping PROTOCOL_BINARY_CMD_SASL_AUTH and going
directly to PROTOCOL_BINARY_CMD_SASL_STEP caused the server
to crash because the c->sasl_conn wasn't initialized (and
hence a NIL pointer)

Change-Id: Idecf0b63acb8befff08bcea02ea8451e1840e4b6
Reviewed-on: http://review.couchbase.org/38689
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reset auth_data when called for an invalid connection

Change-Id: Icd9d8b14e51e12348f2702f1ea60bf543a6255d6
Reviewed-on: http://review.couchbase.org/38690
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Merge remote-tracking branch 'membase/3.0'

* membase/3.0:
  Reset auth_data when called for an invalid connection
  MB-11501: Client may cause server to crash in SASL

Change-Id: I35334ea9b4619ac426a86831bb18e960f1dd003f