s3:torture: Fix spoolss test to build with -O3
authorAndreas Schneider <asn@samba.org>
Wed, 9 Aug 2017 06:23:29 +0000 (08:23 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 9 Aug 2017 07:49:08 +0000 (09:49 +0200)
Initialize variables so that we do not get a build warning that they
might be used uninitilized.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12930

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source4/torture/rpc/spoolss.c

index 14a43b97f6d6b177d776235a720045666dcd6e23..89e9a134eff82629c110adba3a56fe1575ec024d 100644 (file)
@@ -2667,8 +2667,8 @@ static bool test_EnumForms_find_one(struct torture_context *tctx,
                                    bool print_server,
                                    const char *form_name)
 {
                                    bool print_server,
                                    const char *form_name)
 {
-       union spoolss_FormInfo *info;
-       uint32_t count;
+       union spoolss_FormInfo *info = NULL;
+       uint32_t count = 0;
        bool found = false;
        int i;
 
        bool found = false;
        int i;
 
@@ -5554,11 +5554,12 @@ static bool test_SetPrinterDataEx_values(struct torture_context *tctx,
 
        for (i=0; i < ARRAY_SIZE(values); i++) {
 
 
        for (i=0; i < ARRAY_SIZE(values); i++) {
 
-               enum winreg_Type type;
-               DATA_BLOB blob_in, blob_out;
+               enum winreg_Type type = REG_NONE;
+               DATA_BLOB blob_in = data_blob_null;
+               DATA_BLOB blob_out = data_blob_null;
                uint32_t ecount;
                struct spoolss_PrinterEnumValues *einfo;
                uint32_t ecount;
                struct spoolss_PrinterEnumValues *einfo;
-               uint32_t needed;
+               uint32_t needed = 0;
 
                if (torture_setting_bool(tctx, "samba3", false)) {
                        char *q;
 
                if (torture_setting_bool(tctx, "samba3", false)) {
                        char *q;