diff options
author | Volker Lendecke <vl@samba.org> | 2013-11-09 18:40:08 +0100 |
---|---|---|
committer | Ira Cooper <ira@samba.org> | 2013-11-11 21:04:08 +0100 |
commit | 55b0a16e9b08cb4bf5cf32307009b889b4288f3a (patch) | |
tree | a10f1c4b79e97ece03d83157711b043635f4f850 /source4/lib | |
parent | ba370ae630e1f35cd20d6419100b5e0987382cfc (diff) | |
download | samba-55b0a16e9b08cb4bf5cf32307009b889b4288f3a.tar.gz samba-55b0a16e9b08cb4bf5cf32307009b889b4288f3a.tar.xz samba-55b0a16e9b08cb4bf5cf32307009b889b4288f3a.zip |
registry: Fix Coverity ID 1034918 Wrong sizeof argument
sizeof(data_val) is the size of the pointer. This might well be 8 bytes
where the string is only 4 bytes long
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/registry/tests/registry.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/lib/registry/tests/registry.c b/source4/lib/registry/tests/registry.c index 0c3c395e65f..b9b7c288e6d 100644 --- a/source4/lib/registry/tests/registry.c +++ b/source4/lib/registry/tests/registry.c @@ -552,14 +552,14 @@ static bool test_list_values(struct torture_context *tctx, void *_data) "getting missing value"); error = reg_val_set(subkey, "", REG_SZ, - data_blob_talloc(tctx, data_val, sizeof(data_val))); + data_blob_talloc(tctx, data_val, strlen(data_val))); torture_assert_werr_ok(tctx, error, "set default value"); error = reg_key_get_value_by_index(tctx, subkey, 0, &name, &type, &data); torture_assert_werr_ok(tctx, error, "getting default value"); torture_assert_int_equal(tctx, REG_SZ, type, "value type ok"); - torture_assert_int_equal(tctx, sizeof(data_val), data.length, "value length ok"); + torture_assert_int_equal(tctx, strlen(data_val), data.length, "value length ok"); torture_assert_str_equal(tctx, data_val, (char *)data.data, "value ok"); return true; |