summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-01-25 20:32:59 +0100
committerVolker Lendecke <vl@samba.org>2009-01-25 20:52:39 +0100
commit28b7c44de846930e5f7c9aae3a7a423368c03ae1 (patch)
tree81a8054b37cf01181ff92f1bed315e4fb2c78005
parentc0fea1f0f791f0b2a161f5c89fd532ce2270c240 (diff)
downloadsamba-28b7c44de846930e5f7c9aae3a7a423368c03ae1.tar.gz
samba-28b7c44de846930e5f7c9aae3a7a423368c03ae1.tar.bz2
samba-28b7c44de846930e5f7c9aae3a7a423368c03ae1.zip
Make smb_bytes_push_str deal with a NULL buf returning NULL
-rw-r--r--source3/libsmb/clifile.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 7c75826414..04bbabe087 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -783,10 +783,15 @@ int cli_nt_create(struct cli_state *cli, const char *fname, uint32 DesiredAccess
uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str)
{
- size_t buflen = talloc_get_size(buf);
+ size_t buflen;
char *converted;
size_t converted_size;
+ if (buf == NULL) {
+ return NULL;
+ }
+
+ buflen = talloc_get_size(buf);
/*
* We're pushing into an SMB buffer, align odd
*/