[PATCH] fix some compile warnings
Christian Ambach
ambi at samba.org
Thu Dec 12 14:28:59 MST 2013
Hi list,
the attached patchset fixes some compile warnings I get on my
64bit Ubuntu using gcc -O3.
Please review
Cheers,
Christian
-------------- next part --------------
>From 06b3686956c4aebc49f254dfecf391f9c4f432be Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:43:55 +0100
Subject: [PATCH 01/21] lib/compression: fix a compiler warnings
about set but unused variable
Signed-off-by: Christian Ambach <ambi at samba.org>
---
lib/compression/testsuite.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/lib/compression/testsuite.c b/lib/compression/testsuite.c
index 5758891..d897c88 100644
--- a/lib/compression/testsuite.c
+++ b/lib/compression/testsuite.c
@@ -29,7 +29,6 @@
static bool test_lzxpress(struct torture_context *test)
{
TALLOC_CTX *tmp_ctx = talloc_new(test);
- uint8_t *data;
const char *fixed_data = "this is a test. and this is a test too";
const uint8_t fixed_out[] = { 0x00, 0x20, 0x00, 0x04, 0x74, 0x68, 0x69, 0x73,
0x20, 0x10, 0x00, 0x61, 0x20, 0x74, 0x65, 0x73,
@@ -39,7 +38,6 @@ static bool test_lzxpress(struct torture_context *test)
ssize_t c_size;
uint8_t *out, *out2;
- data = talloc_size(tmp_ctx, 1023);
out = talloc_size(tmp_ctx, 2048);
memset(out, 0x42, talloc_get_size(out));
--
1.8.1.2
>From e9317f279a70b895f7205a4f6b6bd753230cac1d Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:45:14 +0100
Subject: [PATCH 02/21] lib/ldb-samba: fix a compiler warning
about macro redefinition
Signed-off-by: Christian Ambach <ambi at samba.org>
---
lib/ldb-samba/ldb_wrap.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/ldb-samba/ldb_wrap.c b/lib/ldb-samba/ldb_wrap.c
index 65956ef..05d0451 100644
--- a/lib/ldb-samba/ldb_wrap.c
+++ b/lib/ldb-samba/ldb_wrap.c
@@ -37,6 +37,7 @@
#include "../lib/util/dlinklist.h"
#include <tdb.h>
+#undef DBGC_CLASS
#define DBGC_CLASS DBGC_LDB
/*
--
1.8.1.2
>From 05cc835939c27c03a8ed5ae3a2a5b6338fb2cf69 Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:45:58 +0100
Subject: [PATCH 03/21] lib/ldb fix compiler warnings
about potentially uninitialized variables
Signed-off-by: Christian Ambach <ambi at samba.org>
---
lib/ldb/common/ldb_dn.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/ldb/common/ldb_dn.c b/lib/ldb/common/ldb_dn.c
index 14596f6..6b6f90c 100644
--- a/lib/ldb/common/ldb_dn.c
+++ b/lib/ldb/common/ldb_dn.c
@@ -287,7 +287,7 @@ char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
*/
static bool ldb_dn_explode(struct ldb_dn *dn)
{
- char *p, *ex_name, *ex_value, *data, *d, *dt, *t;
+ char *p, *ex_name = NULL, *ex_value = NULL, *data, *d, *dt, *t;
bool trim = true;
bool in_extended = true;
bool in_ex_name = false;
@@ -298,7 +298,7 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
bool is_oid = false;
bool escape = false;
unsigned int x;
- size_t l;
+ size_t l = 0;
int ret;
char *parse_dn;
bool is_index;
--
1.8.1.2
>From 537b351e0f2460abfc37a70f26c9a0ceb8fbbf56 Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:46:30 +0100
Subject: [PATCH 04/21] lib/ldb fix compiler warnings
about potentially uninitialized variables
Signed-off-by: Christian Ambach <ambi at samba.org>
---
lib/ldb/ldb_map/ldb_map_inbound.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/ldb/ldb_map/ldb_map_inbound.c b/lib/ldb/ldb_map/ldb_map_inbound.c
index 06d52aa..461e681 100644
--- a/lib/ldb/ldb_map/ldb_map_inbound.c
+++ b/lib/ldb/ldb_map/ldb_map_inbound.c
@@ -476,7 +476,7 @@ static int map_add_do_local(struct map_context *ac)
int ldb_map_modify(struct ldb_module *module, struct ldb_request *req)
{
const struct ldb_message *msg = req->op.mod.message;
- struct ldb_request *search_req;
+ struct ldb_request *search_req = NULL;
struct ldb_message *remote_msg;
struct ldb_context *ldb;
struct map_context *ac;
@@ -699,7 +699,7 @@ static int map_delete_do_local(struct map_context *ac)
/* Rename a record. */
int ldb_map_rename(struct ldb_module *module, struct ldb_request *req)
{
- struct ldb_request *search_req;
+ struct ldb_request *search_req = NULL;
struct ldb_context *ldb;
struct map_context *ac;
int ret;
--
1.8.1.2
>From 2b3a11525122b1f4908b57904b28b7b659e6f5c1 Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:47:05 +0100
Subject: [PATCH 05/21] lib/tdb: fix compiler warnings
about a variable shadowing a global declaration
Signed-off-by: Christian Ambach <ambi at samba.org>
---
lib/tdb/common/summary.c | 10 +++++-----
lib/tdb/test/run-3G-file.c | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/tdb/common/summary.c b/lib/tdb/common/summary.c
index 3c6f755..a22c17d 100644
--- a/lib/tdb/common/summary.c
+++ b/lib/tdb/common/summary.c
@@ -88,7 +88,7 @@ static size_t get_hash_length(struct tdb_context *tdb, unsigned int i)
_PUBLIC_ char *tdb_summary(struct tdb_context *tdb)
{
tdb_off_t off, rec_off;
- struct tally freet, keys, data, dead, extra, hash, uncoal;
+ struct tally freet, keys, data, dead, extra, hashval, uncoal;
struct tdb_record rec;
char *ret = NULL;
bool locked;
@@ -114,7 +114,7 @@ _PUBLIC_ char *tdb_summary(struct tdb_context *tdb)
tally_init(&data);
tally_init(&dead);
tally_init(&extra);
- tally_init(&hash);
+ tally_init(&hashval);
tally_init(&uncoal);
for (off = TDB_DATA_START(tdb->hash_size);
@@ -161,7 +161,7 @@ _PUBLIC_ char *tdb_summary(struct tdb_context *tdb)
tally_add(&uncoal, unc - 1);
for (off = 0; off < tdb->hash_size; off++)
- tally_add(&hash, get_hash_length(tdb, off));
+ tally_add(&hashval, get_hash_length(tdb, off));
/* 20 is max length of a %zu. */
len = strlen(SUMMARY_FORMAT) + 35*20 + 1;
@@ -180,8 +180,8 @@ _PUBLIC_ char *tdb_summary(struct tdb_context *tdb)
dead.min, tally_mean(&dead), dead.max,
freet.num,
freet.min, tally_mean(&freet), freet.max,
- hash.num,
- hash.min, tally_mean(&hash), hash.max,
+ hashval.num,
+ hashval.min, tally_mean(&hashval), hashval.max,
uncoal.total,
uncoal.min, tally_mean(&uncoal), uncoal.max,
keys.total * 100.0 / tdb->map_size,
diff --git a/lib/tdb/test/run-3G-file.c b/lib/tdb/test/run-3G-file.c
index 3ee9de1..f21544a 100644
--- a/lib/tdb/test/run-3G-file.c
+++ b/lib/tdb/test/run-3G-file.c
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
{
struct tdb_context *tdb;
TDB_DATA key, orig_data, data;
- uint32_t hash;
+ uint32_t hashval;
tdb_off_t rec_ptr;
struct tdb_record rec;
int ret;
@@ -113,8 +113,8 @@ int main(int argc, char *argv[])
free(data.dptr);
/* That currently fills at the end, make sure that's true. */
- hash = tdb->hash_fn(&key);
- rec_ptr = tdb_find_lock_hash(tdb, key, hash, F_RDLCK, &rec);
+ hashval = tdb->hash_fn(&key);
+ rec_ptr = tdb_find_lock_hash(tdb, key, hashval, F_RDLCK, &rec);
ok1(rec_ptr);
ok1(rec_ptr > 2U*1024*1024*1024);
tdb_unlock(tdb, BUCKET(rec.full_hash), F_RDLCK);
--
1.8.1.2
>From abfe9e873d7867da4c1130d550d3c3a841d9544d Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:47:50 +0100
Subject: [PATCH 06/21] lib/clap fix compiler warnings
about set but unused variable
Signed-off-by: Christian Ambach <ambi at samba.org>
---
libcli/cldap/cldap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libcli/cldap/cldap.c b/libcli/cldap/cldap.c
index e543091..eb4f102 100644
--- a/libcli/cldap/cldap.c
+++ b/libcli/cldap/cldap.c
@@ -930,8 +930,7 @@ char *cldap_netlogon_create_filter(TALLOC_CTX *mem_ctx,
}
if (io->in.domain_guid) {
struct GUID guid;
- NTSTATUS status;
- status = GUID_from_string(io->in.domain_guid, &guid);
+ GUID_from_string(io->in.domain_guid, &guid);
if (filter == NULL) {
return NULL;
}
--
1.8.1.2
>From 8800a87cb5a4e374d1d3ab1d276872aec84aa5ca Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:48:25 +0100
Subject: [PATCH 07/21] libcli: fix compiler warnings
about missing prototypes
Signed-off-by: Christian Ambach <ambi at samba.org>
---
libcli/nbt/nbtname.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libcli/nbt/nbtname.c b/libcli/nbt/nbtname.c
index fd49334..5be7830 100644
--- a/libcli/nbt/nbtname.c
+++ b/libcli/nbt/nbtname.c
@@ -28,6 +28,7 @@
#include "librpc/gen_ndr/ndr_misc.h"
#include "system/locale.h"
#include "lib/util/util_net.h"
+#include "libcli/nbt/libnbt.h"
/*
decompress a 'compressed' name component
--
1.8.1.2
>From 64366125af9c07950fe5ab552f9c0c95d6071a2e Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:48:59 +0100
Subject: [PATCH 08/21] s3:libsmb fix a compiler warning
about a potentially uninitialized variable
Signed-off-by: Christian Ambach <ambi at samba.org>
---
source3/libsmb/cliconnect.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 3c9d03a..964d5fd 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -3029,7 +3029,7 @@ static void cli_connect_nb_done(struct tevent_req *subreq)
struct cli_connect_nb_state *state = tevent_req_data(
req, struct cli_connect_nb_state);
NTSTATUS status;
- int fd;
+ int fd = 0;
uint16_t port;
status = cli_connect_sock_recv(subreq, &fd, &port);
--
1.8.1.2
>From d50d1c6eaa36aa5c8f6628966221312052adac8f Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:49:18 +0100
Subject: [PATCH 09/21] s3:printing fix a compiler warning
about a potentially uninitialized variable
Signed-off-by: Christian Ambach <ambi at samba.org>
---
source3/printing/spoolssd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source3/printing/spoolssd.c b/source3/printing/spoolssd.c
index 8f182f8..0b6980a 100644
--- a/source3/printing/spoolssd.c
+++ b/source3/printing/spoolssd.c
@@ -372,7 +372,7 @@ static int spoolss_children_main(struct tevent_context *ev_ctx,
{
struct spoolss_children_data *data;
bool ok;
- int ret;
+ int ret = 0;
ok = spoolss_child_init(ev_ctx, child_id, pf);
if (!ok) {
--
1.8.1.2
>From aa0cea37e61a30a08894ecf45eaf943e1a253fe6 Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:49:44 +0100
Subject: [PATCH 10/21] s3:smbd/smb2 fix compiler warnings
about a potentially uninitialized variables
Signed-off-by: Christian Ambach <ambi at samba.org>
---
source3/smbd/smb2_close.c | 16 ++++++++--------
source3/smbd/smb2_sesssetup.c | 4 ++--
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/source3/smbd/smb2_close.c b/source3/smbd/smb2_close.c
index c4f0f19..dce8cac 100644
--- a/source3/smbd/smb2_close.c
+++ b/source3/smbd/smb2_close.c
@@ -83,14 +83,14 @@ static void smbd_smb2_request_close_done(struct tevent_req *subreq)
tevent_req_callback_data(subreq,
struct smbd_smb2_request);
DATA_BLOB outbody;
- uint16_t out_flags;
- NTTIME out_creation_time;
- NTTIME out_last_access_time;
- NTTIME out_last_write_time;
- NTTIME out_change_time;
- uint64_t out_allocation_size;
- uint64_t out_end_of_file;
- uint32_t out_file_attributes;
+ uint16_t out_flags = 0;
+ NTTIME out_creation_time = 0;
+ NTTIME out_last_access_time = 0;
+ NTTIME out_last_write_time = 0;
+ NTTIME out_change_time = 0;
+ uint64_t out_allocation_size = 0;
+ uint64_t out_end_of_file = 0;
+ uint32_t out_file_attributes = 0;
NTSTATUS status;
NTSTATUS error;
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index cb8f847..edef0cc 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -111,8 +111,8 @@ static void smbd_smb2_request_sesssetup_done(struct tevent_req *subreq)
uint8_t *outhdr;
DATA_BLOB outbody;
DATA_BLOB outdyn;
- uint16_t out_session_flags;
- uint64_t out_session_id;
+ uint16_t out_session_flags = 0;
+ uint64_t out_session_id = 0;
uint16_t out_security_offset;
DATA_BLOB out_security_buffer = data_blob_null;
NTSTATUS status;
--
1.8.1.2
>From f0414e08129b192da8dfb919399ea663c72ed527 Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:50:36 +0100
Subject: [PATCH 11/21] s3:winbindd fix a compiler warning
about a potentially uninitialized variable
Signed-off-by: Christian Ambach <ambi at samba.org>
---
source3/winbindd/wb_group_members.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/source3/winbindd/wb_group_members.c b/source3/winbindd/wb_group_members.c
index ecd07cf..ec36cda 100644
--- a/source3/winbindd/wb_group_members.c
+++ b/source3/winbindd/wb_group_members.c
@@ -139,7 +139,7 @@ static struct tevent_req *wb_groups_members_send(TALLOC_CTX *mem_ctx,
int num_groups,
struct wbint_Principal *groups)
{
- struct tevent_req *req, *subreq;
+ struct tevent_req *req, *subreq = NULL;
struct wb_groups_members_state *state;
NTSTATUS status;
@@ -290,7 +290,7 @@ struct tevent_req *wb_group_members_send(TALLOC_CTX *mem_ctx,
enum lsa_SidType type,
int max_depth)
{
- struct tevent_req *req, *subreq;
+ struct tevent_req *req, *subreq = NULL;
struct wb_group_members_state *state;
NTSTATUS status;
--
1.8.1.2
>From 4cd5d0368879d709153a0025731e5560ae9b92d4 Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:52:29 +0100
Subject: [PATCH 12/21] s4:dsdb fix compiler warnings
about potentially uninitialized variables
Signed-off-by: Christian Ambach <ambi at samba.org>
---
source4/dsdb/samdb/ldb_modules/descriptor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source4/dsdb/samdb/ldb_modules/descriptor.c b/source4/dsdb/samdb/ldb_modules/descriptor.c
index ceac8db..cc0a9c2 100644
--- a/source4/dsdb/samdb/ldb_modules/descriptor.c
+++ b/source4/dsdb/samdb/ldb_modules/descriptor.c
@@ -501,7 +501,7 @@ static int descriptor_search_callback(struct ldb_request *req, struct ldb_reply
struct ldb_val *sd_val = NULL;
struct ldb_message_element *sd_el;
DATA_BLOB *show_sd;
- int ret;
+ int ret = LDB_SUCCESS;
ac = talloc_get_type(req->context, struct descriptor_context);
--
1.8.1.2
>From 4ece32da67634a9384df56d23a3865338cb4e961 Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:52:29 +0100
Subject: [PATCH 13/21] s4:dsdb fix compiler warnings
about potentially uninitialized variables
Signed-off-by: Christian Ambach <ambi at samba.org>
---
source4/dsdb/samdb/ldb_modules/password_hash.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c
index 7974169..3e0f1a0 100644
--- a/source4/dsdb/samdb/ldb_modules/password_hash.c
+++ b/source4/dsdb/samdb/ldb_modules/password_hash.c
@@ -2614,7 +2614,7 @@ static int get_domain_data_callback(struct ldb_request *req,
struct ldb_context *ldb;
struct ph_context *ac;
struct loadparm_context *lp_ctx;
- int ret;
+ int ret = LDB_SUCCESS;
ac = talloc_get_type(req->context, struct ph_context);
ldb = ldb_module_get_ctx(ac->module);
@@ -3151,7 +3151,7 @@ static int ph_mod_search_callback(struct ldb_request *req, struct ldb_reply *are
{
struct ldb_context *ldb;
struct ph_context *ac;
- int ret;
+ int ret = LDB_SUCCESS;
ac = talloc_get_type(req->context, struct ph_context);
ldb = ldb_module_get_ctx(ac->module);
--
1.8.1.2
>From 1b91bd74073b5f1dde798f4ff846f75f4e1e7b8a Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:52:29 +0100
Subject: [PATCH 14/21] s4:dsdb fix compiler warnings
about potentially uninitialized variables
Signed-off-by: Christian Ambach <ambi at samba.org>
---
source4/dsdb/samdb/ldb_modules/samba_dsdb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source4/dsdb/samdb/ldb_modules/samba_dsdb.c b/source4/dsdb/samdb/ldb_modules/samba_dsdb.c
index 4697c09..249f655 100644
--- a/source4/dsdb/samdb/ldb_modules/samba_dsdb.c
+++ b/source4/dsdb/samdb/ldb_modules/samba_dsdb.c
@@ -232,7 +232,7 @@ static int samba_dsdb_init(struct ldb_module *module)
int ret, len, i;
TALLOC_CTX *tmp_ctx = talloc_new(module);
struct ldb_result *res;
- struct ldb_message *rootdse_msg, *partition_msg;
+ struct ldb_message *rootdse_msg = NULL, *partition_msg;
struct ldb_dn *samba_dsdb_dn, *partition_dn;
struct ldb_module *backend_module, *module_chain;
const char **final_module_list, **reverse_module_list;
--
1.8.1.2
>From aa5131711262f8fc176f2eb5b5aee71ee7f9565c Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:52:29 +0100
Subject: [PATCH 15/21] s4:dsdb fix compiler warnings
about potentially uninitialized variables
Signed-off-by: Christian Ambach <ambi at samba.org>
---
source4/dsdb/samdb/ldb_modules/samldb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index b798102..144d5a5 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -2002,7 +2002,7 @@ static int samldb_service_principal_names_change(struct samldb_ctx *ac)
/* Create a temporary message for fetching the "sAMAccountName" */
if (el2 != NULL) {
- char *tempstr, *tempstr2;
+ char *tempstr, *tempstr2 = NULL;
const char *acct_attrs[] = { "sAMAccountName", NULL };
msg = ldb_msg_new(ac->msg);
--
1.8.1.2
>From 070c26b809f76e6eec3e2ab3f117a3fa9e89dd13 Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:52:30 +0100
Subject: [PATCH 16/21] s4:dsdb fix compiler warnings
about potentially uninitialized variables
Signed-off-by: Christian Ambach <ambi at samba.org>
---
source4/dsdb/samdb/ldb_modules/update_keytab.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source4/dsdb/samdb/ldb_modules/update_keytab.c b/source4/dsdb/samdb/ldb_modules/update_keytab.c
index bec4a83..0bc7f2a 100644
--- a/source4/dsdb/samdb/ldb_modules/update_keytab.c
+++ b/source4/dsdb/samdb/ldb_modules/update_keytab.c
@@ -379,7 +379,7 @@ static int update_kt_prepare_commit(struct ldb_module *module)
struct smb_krb5_context *smb_krb5_context;
int krb5_ret = smb_krb5_init_context(data, ldb_get_event_context(ldb), ldb_get_opaque(ldb, "loadparm"),
&smb_krb5_context);
- TALLOC_CTX *tmp_ctx;
+ TALLOC_CTX *tmp_ctx = NULL;
if (krb5_ret != 0) {
ldb_asprintf_errstring(ldb, "Failed to setup krb5_context: %s", error_message(krb5_ret));
--
1.8.1.2
>From 5430dd3dfc21096229e513d7b09754f970d9e129 Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:53:15 +0100
Subject: [PATCH 17/21] s4:dsdb fix compiler warnings
about potentially uninitialized variables
Signed-off-by: Christian Ambach <ambi at samba.org>
---
source4/dsdb/samdb/ldb_modules/dirsync.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source4/dsdb/samdb/ldb_modules/dirsync.c b/source4/dsdb/samdb/ldb_modules/dirsync.c
index e769948..69bb5a2 100644
--- a/source4/dsdb/samdb/ldb_modules/dirsync.c
+++ b/source4/dsdb/samdb/ldb_modules/dirsync.c
@@ -70,7 +70,7 @@ static int dirsync_filter_entry(struct ldb_request *req,
bool referral)
{
struct ldb_context *ldb;
- uint64_t val;
+ uint64_t val = 0;
enum ndr_err_code ndr_err;
uint32_t n;
int i;
--
1.8.1.2
>From 0b7467b46ff009a9f769320e8ce035606d705ec2 Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:53:49 +0100
Subject: [PATCH 18/21] s4:echo_server fix compiler warnings
about set but unused variables
Signed-off-by: Christian Ambach <ambi at samba.org>
---
source4/echo_server/echo_server.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/source4/echo_server/echo_server.c b/source4/echo_server/echo_server.c
index 3501c89..5444bc7 100644
--- a/source4/echo_server/echo_server.c
+++ b/source4/echo_server/echo_server.c
@@ -157,10 +157,9 @@ static void echo_udp_call_sendto_done(struct tevent_req *subreq)
{
struct echo_udp_call *call = tevent_req_callback_data(subreq,
struct echo_udp_call);
- ssize_t ret;
int sys_errno;
- ret = tdgram_sendto_queue_recv(subreq, &sys_errno);
+ tdgram_sendto_queue_recv(subreq, &sys_errno);
/*
* We don't actually care about the error, just get on with our life.
--
1.8.1.2
>From 1db172ad2f455f11f3181add5d7d3bb8e3932729 Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:54:05 +0100
Subject: [PATCH 19/21] s4:kdc fix compiler warnings
about set but unused variables
Signed-off-by: Christian Ambach <ambi at samba.org>
---
source4/kdc/kdc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c
index a893906..498ee4d 100644
--- a/source4/kdc/kdc.c
+++ b/source4/kdc/kdc.c
@@ -617,10 +617,9 @@ static void kdc_udp_call_sendto_done(struct tevent_req *subreq)
{
struct kdc_udp_call *call = tevent_req_callback_data(subreq,
struct kdc_udp_call);
- ssize_t ret;
int sys_errno;
- ret = tdgram_sendto_queue_recv(subreq, &sys_errno);
+ tdgram_sendto_queue_recv(subreq, &sys_errno);
/* We don't care about errors */
--
1.8.1.2
>From e7612a61a0e1a90b689c7433c5c1ccc65769ace4 Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 17:54:37 +0100
Subject: [PATCH 20/21] s4:libcli fix compiler warnings
about potentially uninitialized variables
Signed-off-by: Christian Ambach <ambi at samba.org>
---
source4/libcli/clilist.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/source4/libcli/clilist.c b/source4/libcli/clilist.c
index 65ee0a8..2fa4112 100644
--- a/source4/libcli/clilist.c
+++ b/source4/libcli/clilist.c
@@ -111,7 +111,7 @@ int smbcli_list_new(struct smbcli_tree *tree, const char *Mask, uint16_t attribu
int num_received = 0;
int max_matches = 512;
char *mask;
- int ff_eos = 0, i, ff_searchcount;
+ int ff_eos = 0, i;
int ff_dir_handle=0;
/* initialize state for search */
@@ -154,7 +154,6 @@ int smbcli_list_new(struct smbcli_tree *tree, const char *Mask, uint16_t attribu
}
ff_dir_handle = first_parms.t2ffirst.out.handle;
- ff_searchcount = first_parms.t2ffirst.out.count;
ff_eos = first_parms.t2ffirst.out.end_of_search;
received = first_parms.t2ffirst.out.count;
@@ -181,7 +180,6 @@ int smbcli_list_new(struct smbcli_tree *tree, const char *Mask, uint16_t attribu
if (!NT_STATUS_IS_OK(status)) {
return -1;
}
- ff_searchcount = next_parms.t2fnext.out.count;
ff_eos = next_parms.t2fnext.out.end_of_search;
received = next_parms.t2fnext.out.count;
if (received <= 0) break;
--
1.8.1.2
>From c67effd02e2cf795ad10eb338f1cb280c9561621 Mon Sep 17 00:00:00 2001
From: Christian Ambach <ambi at samba.org>
Date: Tue, 10 Dec 2013 20:31:21 +0100
Subject: [PATCH 21/21] s4:rpc_server/lsa_lookup fix a compile warning
about a set, but unused variable
Signed-off-by: Christian Ambach <ambi at samba.org>
---
source4/rpc_server/lsa/lsa_lookup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source4/rpc_server/lsa/lsa_lookup.c b/source4/rpc_server/lsa/lsa_lookup.c
index fb4767d..693c0c97 100644
--- a/source4/rpc_server/lsa/lsa_lookup.c
+++ b/source4/rpc_server/lsa/lsa_lookup.c
@@ -676,7 +676,7 @@ static NTSTATUS dcesrv_lsa_LookupSids_common(struct dcesrv_call_state *dce_call,
return STATUS_SOME_UNMAPPED;
}
- return NT_STATUS_OK;
+ return status;
}
/*
--
1.8.1.2
More information about the samba-technical
mailing list