[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: (ITS#6338) dnParent(x, x) can remove \0-termination
h.b.furuseth@usit.uio.no wrote:
> Full_Name: Hallvard B Furuseth
> Version: HEAD, RE24
> OS:
> URL:
> Submission from: (NULL) (129.240.6.233)
> Submitted by: hallvard
>
>
> This:
> struct berval x = BER_BVC("cn=foo");
> dnParent(x, x);
> keeps x.bv_val pointing at "cn=foo" instead of at the \0
> behind it. bv_len is correctly set to 0 though.
Could be sort of intentional. As far as I remember, dnParent() is
supposed to leave the second argument untouched, as it is often used on
read-only data. Probably, the most appropriate fix consists in passing
a temporary as the first argument.
p.