summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAravind Srinivasan <aravind.srinivasan@isilon.com>2009-09-23 20:37:04 +0000
committerTim Prouty <tprouty@samba.org>2009-09-24 10:59:33 -0700
commit32ee9767088fcd395e1f1a22d781d33b076aa78b (patch)
tree2d46041d2b9f30ddd9597c5d4d90f791a83260c9 /source3
parent637901c24288740d51f28e2378c02d956dd7b17d (diff)
downloadsamba-32ee9767088fcd395e1f1a22d781d33b076aa78b.tar.gz
samba-32ee9767088fcd395e1f1a22d781d33b076aa78b.tar.bz2
samba-32ee9767088fcd395e1f1a22d781d33b076aa78b.zip
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>
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_catia.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index 2631060441..14e404f9f5 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -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) {