DATA_BLOB type_blob = data_blob_null;
uint32_t type;
+ static char null_byte = '\0';
+ const krb5_data null_data = smb_krb5_make_data(&null_byte, 0);
+
if (forced_next_type != 0) {
/*
* We need to inject possible missing types
}
}
+ /*
+ * Passing a NULL pointer into krb5_pac_add_buffer() is
+ * not allowed, so pass null_data instead if needed.
+ */
code = krb5_pac_add_buffer(context,
new_pac,
type,
- &type_data);
+ (type_data.data != NULL) ? &type_data : &null_data);
smb_krb5_free_data_contents(context, &type_data);
if (code != 0) {
goto done;