summaryrefslogtreecommitdiff
path: root/source3/libsmb/libsmbclient.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libsmb/libsmbclient.c')
-rw-r--r--source3/libsmb/libsmbclient.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c
index 7cbe4a639b..7a390a83f2 100644
--- a/source3/libsmb/libsmbclient.c
+++ b/source3/libsmb/libsmbclient.c
@@ -1282,8 +1282,8 @@ smbc_write_ctx(SMBCCTX *context,
pstring path, targetpath;
struct cli_state *targetcli;
- offset = file->offset; /* See "offset" comment in smbc_read_ctx() */
-
+ /* First check all pointers before dereferencing them */
+
if (!context || !context->internal ||
!context->internal->_initialized) {
@@ -1308,6 +1308,8 @@ smbc_write_ctx(SMBCCTX *context,
}
+ offset = file->offset; /* See "offset" comment in smbc_read_ctx() */
+
/*d_printf(">>>write: parsing %s\n", file->fname);*/
if (smbc_parse_path(context, file->fname,
NULL, 0,