- cb[0].id= SASL_CB_USER;
- cb[0].proc= get_username;
- cb[0].context= strncpy(name, username, sizeof(cb[0].context));
- cb[1].id= SASL_CB_AUTHNAME;
- cb[1].proc= get_username;
- cb[1].context= name;
- cb[2].id= SASL_CB_PASS;
- cb[2].proc= get_password;
- cb[2].context= secret;
- cb[3].id= SASL_CB_LIST_END;
-
- ptr->sasl.callbacks= cb;
+ callbacks[0].id= SASL_CB_USER;
+ callbacks[0].proc= get_username;
+ callbacks[0].context= strncpy(name, username, username_length +1);
+ callbacks[1].id= SASL_CB_AUTHNAME;
+ callbacks[1].proc= get_username;
+ callbacks[1].context= name;
+ callbacks[2].id= SASL_CB_PASS;
+ callbacks[2].proc= get_password;
+ callbacks[2].context= secret;
+ callbacks[3].id= SASL_CB_LIST_END;
+
+ ptr->sasl.callbacks= callbacks;