Source-Changes-D archive

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

Re: CVS commit: src/usr.bin/make

On Sat, Nov 03, 2012 at 02:25:14AM +0000, Simon J. Gerraty wrote:
> Module Name:  src
> Committed By: sjg
> Date:         Sat Nov  3 02:25:13 UTC 2012
> Modified Files:
>       src/usr.bin/make: cond.c
> Log Message:
> Allow cond_state[] to grow.
> The need is rare, but real.

128 nested conditional was expected to be far more than imaginable.

There is also an off-by-one error is the new code.
The original code had:
    static enum if_states cond_state[MAXIF + 1] = { IF_ACTIVE };
(note the +1)
This isn't allowed for in the new code - and it will overwrite
the end of the malloced area.

You need to move the realloc() below the cond_depth+++

I'm then not sure that 128+n*32 is a sane sequence.
Possibly just n*32 - since I suspect 32 is plenty for most makefiles.


David Laight:

Home | Main Index | Thread Index | Old Index