Re: [PATCH] string_list_append: always set util pointer to NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> It is not immediately obvious that the util field may
> contain random bytes after appending an item. Especially
> since the string_list_insert* functions _do_ explicitly zero
> the util pointer.
>
> This does not appear to be a bug in any current git code, as
> all callers either fill in the util field immediately or
> never use it. However, it is worth it to be less surprising
> to new users of the string-list API who may expect it to be
> intialized to NULL.
>
> Signed-off-by: Jeff King <peff@xxxxxxxx>
> ---
> This bit me in some new code I was writing. I consider it a bug fix, but ...

Of course; the "Especially since" part is very convincing.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]