Skip to content

Instantly share code, notes, and snippets.

@mnunberg
Forked from avsej/gist:2322804
Created April 6, 2012 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnunberg/2322828 to your computer and use it in GitHub Desktop.
Save mnunberg/2322828 to your computer and use it in GitHub Desktop.
diff --git c/src/instance.c w/src/instance.c
index e0101d9..326de45 100644
--- c/src/instance.c
+++ w/src/instance.c
@@ -332,21 +332,21 @@ void libcouchbase_apply_vbucket_config(libcouchbase_t instance, VBUCKET_CONFIG_H
instance->backup_nodes[ii] = instance->backup_nodes[nn];
instance->backup_nodes[nn] = pp;
}
}
instance->sasl.name = vbucket_config_get_user(instance->vbucket_config);
memset(instance->sasl.password.buffer, 0,
sizeof(instance->sasl.password.buffer));
passwd = vbucket_config_get_password(instance->vbucket_config);
if (passwd) {
instance->sasl.password.secret.len = strlen(passwd);
- strcpy((char *)instance->sasl.password.secret.data, passwd);
+ strcpy((char *)(instance->sasl.password.buffer + sizeof(instance->sasl.password.secret.len)), passwd);
}
memcpy(instance->sasl.callbacks, sasl_callbacks, sizeof(sasl_callbacks));
/*
* Run through all of the vbuckets and build a map of what they need.
* It would have been nice if I could query libvbucket for the number
* of vbuckets a server got, but there isn't at the moment..
*/
max = (libcouchbase_uint16_t)vbucket_config_get_num_vbuckets(instance->vbucket_config);
instance->nvbuckets = max;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment