Re: [PATCH 54/67] color: add overflow checks for parsing colors

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

 



Jeff King <peff@xxxxxxxx> writes:

> On Fri, Sep 18, 2015 at 02:54:11PM -0400, Eric Sunshine wrote:
>
>> > @@ -224,12 +227,18 @@ int color_parse_mem(const char *value, int value_len, char *dst)
>> >                         goto bad;
>> >         }
>> >
>> > +#define OUT(x) do { \
>> > +       if (dst == end) \
>> > +               die("BUG: color parsing ran out of space"); \
>> > +       *dst++ = (x); \
>> > +} while(0)
>> 
>> Hmm, can we have an #undef OUT before the #define OUT(...), or choose
>> a less conflict-likely name? In particular, I'm thinking about
>> preprocessor namespace pollution arising from sources out of our
>> control, such as was the case with 414382f (ewah/bitmap: silence
>> warning about MASK macro redefinition, 2015-06-03).
>
> Sure. I wouldn't think any headers would be dumb enough to define
> something as short and common as OUT. But then I would have said the
> same about MASK. ;)
>
> I added an #undef, and I added an #undef at the end of the function, as
> well (to clean up after ourselves).

A tangent.  quote.c does EMIT semi-carefully, but gets sloppy when
it does a similar thing for EMITBUF.

Perhaps it should go to somebody's low-hanging-fruit list ;-)
--
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]