adding one more case to ndr_pull_string_array/ndr_push_string_array

Matthieu Patou mat at samba.org
Sat Sep 4 11:27:30 MDT 2010


  Hi All,

> I propose to add a kind of exception like:
>
> diff --git a/librpc/ndr/ndr_string.c b/librpc/ndr/ndr_string.c
> index 2e04633..8de2257 100644
> --- a/librpc/ndr/ndr_string.c
> +++ b/librpc/ndr/ndr_string.c
> @@ -469,6 +469,11 @@ _PUBLIC_ enum ndr_err_code 
> ndr_pull_string_array(struct ndr_pull *ndr, int ndr_f
>                         tmp_ctx = ndr->current_mem_ctx;
>                         ndr->current_mem_ctx = a;
>                         NDR_CHECK(ndr_pull_string(ndr, ndr_flags, &s));
> +                       if ((ndr->data_size - ndr->offset) == 0 && 
> ndr->flags & LIBNDR_FLAG_REMAINING)
> +                       {
> +                               a[count] = s;
> +                               break;
> +                       }
>                         ndr->current_mem_ctx = tmp_ctx;
>                         if (strcmp("", s)==0) {
>                                 a[count] = NULL;
>
I pushed what seems to me the best solution at :


http://git.samba.org/?p=mat/samba.git;a=commit;h=98f2756237746753ccc6f88f25e273a0ca0a3695


Also http://git.samba.org/?p=mat/samba.git;a=shortlog;h=refs/heads/dfs 
contains fix on dfs also to fix pb that I faced last days.


This branch of course pass make test !
Matthieu
> So that we can handle string_array of null terminated strings but 
> without array terminator.
>
> Let me know.
>
> Matthieu.
>


-- 
Matthieu Patou
Samba Team        http://samba.org



More information about the samba-technical mailing list