Re: [PATCH] color: protect against out-of-bounds array access/assignment

2 messages, 2 authors, 2018-08-02 · open the first message on its own page

Re: [PATCH] color: protect against out-of-bounds array access/assignment

From: Junio C Hamano <hidden>
Date: 2018-08-02 17:36:59

Johannes Schindelin [off-list ref] writes:
Hi Eric,

On Thu, 2 Aug 2018, Eric Sunshine wrote:
quoted
want_color_fd() is designed to work only with standard input, output,
and error file descriptors, and stores information about each descriptor
in an array. However, it doesn't verify that the passed-in descriptor
lives within that set, which, with a buggy caller, could lead to
access/assignment outside the array bounds.
ACK!

Thanks,
Dscho
Did you write a buggy caller that would have been caught or helped
with this change?  You did not write the callee that is made more
defensive with this patch, so I am being curious as to where that
Ack is coming from (I wouldn't have felt curious if this were
a reviewed-by instead).

In any case, this looks like a good defensive measure.

Re: [PATCH] color: protect against out-of-bounds array access/assignment

From: Eric Sunshine <hidden>
Date: 2018-08-02 17:45:21

On Thu, Aug 2, 2018 at 1:37 PM Junio C Hamano [off-list ref] wrote:
Johannes Schindelin [off-list ref] writes:
quoted
ACK!
Did you write a buggy caller that would have been caught or helped
with this change?  You did not write the callee that is made more
defensive with this patch, so I am being curious as to where that
Ack is coming from (I wouldn't have felt curious if this were
a reviewed-by instead).
The code being made more defensive with this patch was authored by Dscho[1].

[1]: 295d949cfa (color: introduce support for colorizing stderr, 2018-04-21)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help