mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
vfs catia: Fix a NULL dereference when CATIA is loaded with no mappings specified.
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>
This commit is contained in:
parent
637901c242
commit
32ee976708
@ -224,8 +224,15 @@ static NTSTATUS catia_string_replace_allocate(connection_struct *conn,
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user