From 28b7c44de846930e5f7c9aae3a7a423368c03ae1 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 25 Jan 2009 20:32:59 +0100 Subject: Make smb_bytes_push_str deal with a NULL buf returning NULL --- source3/libsmb/clifile.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 */ -- cgit