Module Name: src Committed By: rillig Date: Fri Oct 29 19:12:49 UTC 2021
Modified Files: src/usr.bin/indent: indent.c io.c pr_comment.c Log Message: indent: fix undefined behavior in buffer handling Adding an arbitrary integer to a pointer may result in an out of bounds pointer, so replace the addition with a pointer subtraction. In the buffer handling functions, handle 'buf' and 'l' before 's' and 'e', since they are pairs. In inbuf_read_line, use 's' instead of 'buf' to make the code easier to understand for human readers. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.172 -r1.173 src/usr.bin/indent/indent.c cvs rdiff -u -r1.105 -r1.106 src/usr.bin/indent/io.c cvs rdiff -u -r1.88 -r1.89 src/usr.bin/indent/pr_comment.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.