Source-Changes archive

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

CVS commit: src/usr.bin/make



Module Name:    src
Committed By:   rillig
Date:           Sun Aug  9 09:26:21 UTC 2020

Modified Files:
        src/usr.bin/make: main.c

Log Message:
make(1): avoid undefined behavior in Cmd_Exec

Iterating the command output backwards was dangerous since at the end,
the pointer cp pointed outside of the array.  Even without dereferencing
this pointer, this already invokes undefined behavior (C11, 6.5.6p8).
Don't risk anything.  Iterating forwards is probably faster anyway, since
it is more common.


To generate a diff of this commit:
cvs rdiff -u -r1.299 -r1.300 src/usr.bin/make/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index