> I was looking at the recently imported uuid interface in libc and
> noticed the encode functions are broken. In particular, this pattern:
> 
>       uint8_t *p = buf;
>       p[0] = htobe32(uuid->time_low);
>       p[4] = htobe16(uuid->time_mid);
>       p[6] = htobe16(uuid->time_hi_and_version);
> 
> The intention is obviously that the 32-bit and 16-bit values gets copied
> to the buffer, but instead the value gets truncated. The resulting
> encoded uuid will then contain unmodified bytes (likely uninitialized).
> 
> This appears to be the case in the kernel uuid code as well.

Indeed. Thanks for catching this, I'm fixing this issue right now.

Miod

Reply via email to