[PATCH 05/12] Use correct size for test string, sizeof() was of the pointer

Kamen Mazdrashki kamenim at samba.org
Sun Sep 7 21:20:59 MDT 2014


nice catch

Reviewed-by: Kamen Mazdrashki <kamenim at samba.org>

On Mon, Sep 8, 2014 at 1:30 AM, <abartlet at samba.org> wrote:

> From: Andrew Bartlett <abartlet at samba.org>
>
> Found by AddressSanitizer
>
> Change-Id: Ifc9883d958f253df903775544010c0228a102f0f
> Signed-off-by: Andrew Bartlett <abartlet at samba.org>
> ---
>  source4/lib/registry/tests/registry.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/source4/lib/registry/tests/registry.c
> b/source4/lib/registry/tests/registry.c
> index b9b7c28..b4f4ae8 100644
> --- a/source4/lib/registry/tests/registry.c
> +++ b/source4/lib/registry/tests/registry.c
> @@ -270,7 +270,7 @@ static bool test_query_key(struct torture_context
> *tctx, void *_data)
>         torture_assert_int_equal(tctx, num_values, 0, "num values");
>
>         error = reg_val_set(subkey, "", REG_SZ,
> -                           data_blob_talloc(tctx, data, sizeof(data)));
> +                           data_blob_string_const(data));
>         torture_assert_werr_ok(tctx, error, "set default value");
>
>         error = reg_key_get_info(tctx, subkey, &classname,
> --
> 2.1.0
>
>


More information about the samba-technical mailing list