summaryrefslogtreecommitdiff
path: root/source4/smb_server/blob.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-09-10 20:17:39 +1000
committerAndrew Tridgell <tridge@samba.org>2010-09-15 15:39:34 +1000
commit2fbf10ea1b1a52b1d01651d2f9ae4983013f1abd (patch)
tree852d927bd24e777aa8540c2037045c9590381626 /source4/smb_server/blob.c
parenta17da707858baac78d5938313d935572520fabf1 (diff)
downloadsamba-2fbf10ea1b1a52b1d01651d2f9ae4983013f1abd.tar.gz
samba-2fbf10ea1b1a52b1d01651d2f9ae4983013f1abd.tar.bz2
samba-2fbf10ea1b1a52b1d01651d2f9ae4983013f1abd.zip
s4-smb: smbsrv_blob_push_string() can return -1
need to use ssize_t, not size_t for error handling
Diffstat (limited to 'source4/smb_server/blob.c')
-rw-r--r--source4/smb_server/blob.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/source4/smb_server/blob.c b/source4/smb_server/blob.c
index adc223ec7d..62ee61d6b9 100644
--- a/source4/smb_server/blob.c
+++ b/source4/smb_server/blob.c
@@ -100,14 +100,14 @@ size_t smbsrv_blob_pull_string(struct request_bufinfo *bufinfo,
push a string into the data section of a trans2 request
return the number of bytes consumed in the output
*/
-size_t smbsrv_blob_push_string(TALLOC_CTX *mem_ctx,
- DATA_BLOB *blob,
- uint32_t len_offset,
- uint32_t offset,
- const char *str,
- int dest_len,
- int default_flags,
- int flags)
+static ssize_t smbsrv_blob_push_string(TALLOC_CTX *mem_ctx,
+ DATA_BLOB *blob,
+ uint32_t len_offset,
+ uint32_t offset,
+ const char *str,
+ int dest_len,
+ int default_flags,
+ int flags)
{
int alignment = 0, ret = 0, pkt_len;
@@ -142,6 +142,9 @@ size_t smbsrv_blob_push_string(TALLOC_CTX *mem_ctx,
} else {
ret = push_string(blob->data + offset, str, dest_len, flags);
}
+ if (ret == -1) {
+ return -1;
+ }
/* sometimes the string needs to be terminated, but the length
on the wire must not include the termination! */