summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-11-15 17:27:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:52 -0500
commit0a5ea499ecd75eb8f3ec764dd73fba4e228eeabb (patch)
tree055c4c47781a268f98708adf543210f801573f18
parent57d2043479d290bbfa8d2752da454efea330606e (diff)
downloadsamba-0a5ea499ecd75eb8f3ec764dd73fba4e228eeabb.tar.gz
samba-0a5ea499ecd75eb8f3ec764dd73fba4e228eeabb.tar.bz2
samba-0a5ea499ecd75eb8f3ec764dd73fba4e228eeabb.zip
r3762: - only load the readed bytes into the input buffer
- fix compiler warnings with gcc-4.0 metze (This used to be commit 7a931ea0f4884d866bbb05b7b81f8e0598364813)
-rw-r--r--source4/ldap_server/ldap_server.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source4/ldap_server/ldap_server.c b/source4/ldap_server/ldap_server.c
index 9338baa165..9f256b0b8b 100644
--- a/source4/ldap_server/ldap_server.c
+++ b/source4/ldap_server/ldap_server.c
@@ -173,6 +173,7 @@ static BOOL read_into_buf(struct socket_context *sock, struct rw_buffer *buf)
talloc_free(tmp_blob.data);
return False;
}
+ tmp_blob.length = nread;
ret = ldapsrv_append_to_buf(buf, tmp_blob.data, tmp_blob.length);
@@ -188,7 +189,7 @@ static BOOL ldapsrv_read_buf(struct ldapsrv_connection *conn)
DATA_BLOB creds;
BOOL ret;
uint8_t *buf;
- int buf_length, sasl_length;
+ size_t buf_length, sasl_length;
struct socket_context *sock = conn->connection->socket;
TALLOC_CTX *mem_ctx;
size_t nread;
@@ -445,7 +446,7 @@ static void ldapsrv_recv(struct server_connection *conn, struct timeval t,
{
struct ldapsrv_connection *ldap_conn = conn->private_data;
uint8_t *buf;
- int buf_length, msg_length;
+ size_t buf_length, msg_length;
DATA_BLOB blob;
struct asn1_data data;
struct ldapsrv_call *call;