When we use the CATIA vfs module and don't have any mapping specified,
we return NULL for the mapped_name, thereby resulting in segfaults.
When we don't have catia mapping, we should just use the old name
instead of returning NULL for the mapped_name.
Signed-off-by: Tim Prouty <tprouty@samba.org>
size_t converted_size;
TALLOC_CTX *ctx = talloc_tos();
- if (!init_mappings(conn, &selected))
+ if (!init_mappings(conn, &selected)) {
+ /* No mappings found. Just use the old name */
+ *mapped_name = talloc_strdup(NULL, name_in);
+ if (!*mapped_name) {
+ errno = ENOMEM;
+ return NT_STATUS_NO_MEMORY;
+ }
return NT_STATUS_OK;
+ }
if ((push_ucs2_talloc(ctx, &tmpbuf, name_in,
&converted_size)) == -1) {