}
if (userParameters.data) {
- char *newstr;
+ char *newstr = NULL;
old_string = pdb_get_munged_dial(account);
- newstr = (userParameters.length == 0) ? NULL :
- base64_encode_data_blob(talloc_tos(), userParameters);
+
+ if (userParameters.length != 0) {
+ newstr = base64_encode_data_blob(talloc_tos(),
+ userParameters);
+ SMB_ASSERT(newstr != NULL);
+ }
if (STRING_CHANGED_NC(old_string, newstr))
pdb_set_munged_dial(account, newstr, PDB_CHANGED);
if (r->parameters.array) {
DATA_BLOB mung;
- char *newstr;
+ char *newstr = NULL;
old_string = pdb_get_munged_dial(account);
mung.length = r->parameters.length * 2;
mung.data = (uint8_t *) r->parameters.array;
- newstr = (mung.length == 0) ? NULL :
- base64_encode_data_blob(talloc_tos(), mung);
+
+ if (mung.length != 0) {
+ newstr = base64_encode_data_blob(talloc_tos(), mung);
+ SMB_ASSERT(newstr != NULL);
+ }
if (STRING_CHANGED_NC(old_string, newstr))
pdb_set_munged_dial(account, newstr, PDB_CHANGED);
void copy_id20_to_sam_passwd(struct samu *to,
struct samr_UserInfo20 *from)
{
- const char *old_string;
- char *new_string;
DATA_BLOB mung;
if (from == NULL || to == NULL) {
}
if (from->parameters.array) {
+ const char *old_string;
+ char *new_string = NULL;
old_string = pdb_get_munged_dial(to);
mung = data_blob_const(from->parameters.array,
from->parameters.length);
- new_string = (mung.length == 0) ?
- NULL : base64_encode_data_blob(talloc_tos(), mung);
+
+ if (mung.length != 0) {
+ new_string = base64_encode_data_blob(talloc_tos(),
+ mung);
+ SMB_ASSERT(new_string != NULL);
+ }
+
DEBUG(10,("INFO_20 PARAMETERS: %s -> %s\n",
old_string, new_string));
if (STRING_CHANGED_NC(old_string,new_string)) {
if ((from->fields_present & SAMR_FIELD_PARAMETERS) &&
(from->parameters.array)) {
- char *newstr;
+ char *newstr = NULL;
DATA_BLOB mung;
old_string = pdb_get_munged_dial(to);
mung = data_blob_const(from->parameters.array,
from->parameters.length);
- newstr = (mung.length == 0) ?
- NULL : base64_encode_data_blob(talloc_tos(), mung);
+
+ if (mung.length != 0) {
+ newstr = base64_encode_data_blob(talloc_tos(), mung);
+ SMB_ASSERT(newstr != NULL);
+ }
DEBUG(10,("%s SAMR_FIELD_PARAMETERS: %s -> %s\n", l,
old_string, newstr));
if (STRING_CHANGED_NC(old_string,newstr)) {
return;
} else {
base64_key = base64_encode_data_blob(state, session_key);
+ SMB_ASSERT(base64_key != NULL);
x_fprintf(x_stdout, "GK %s\n", base64_key);
talloc_free(base64_key);
}
if (out.length) {
out_base64 = base64_encode_data_blob(mem_ctx, out);
+ SMB_ASSERT(out_base64 != NULL);
} else {
out_base64 = NULL;
}
return;
} else {
base64_key = base64_encode_data_blob(state, session_key);
+ SMB_ASSERT(base64_key != NULL);
mux_printf(mux_id, "GK %s\n", base64_key);
talloc_free(base64_key);
}
if (out.length) {
out_base64 = base64_encode_data_blob(mem_ctx, out);
+ SMB_ASSERT(out_base64 != NULL);
} else {
out_base64 = NULL;
}