HomeFreeBSD

indent(1): Avoid out-of-bound accesses of arrays.

Description

indent(1): Avoid out-of-bound accesses of arrays.

ps.paren_indents:
When ps.paren_level was 0, this was accessing paren_indents[-1].

in_buffer:
This fragment checks if "*/" was read, but there's no guarantee that there
is more than one byte in the array (actually, this happens frequently for
the "{" in things like "int main(void) {").

Submitted by: Piotr Stefaniak

Details

Provenance
pfgAuthored on Dec 2 2016, 4:41 PM
Parents
rGdf54a266d3aa: indent(1): Remove an extra newline added in a previous commit.
Branches
Unknown
Tags
Unknown

Event Timeline