Skip to content

Commit

Permalink
make: Avoid reading an uninitialized value on empty target names
Browse files Browse the repository at this point in the history
Fixing this is however only theoretically useful, as:
* no actual code paths can currently lead to it;
* even if the code actually ended up reading the uninitialized value,
  it would still have a fully defined behavior as the result of the
  check is irrelevant in the only case the uninitialized read can
  happen.

Anyway, fix this to avoid any possible bad surprises in the future.
  • Loading branch information
b4n committed Apr 20, 2015
1 parent 39f359b commit 04c721c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tagmanager/ctags/make.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static boolean isSpecialTarget (vString *const name)
{
size_t i = 0;
/* All special targets begin with '.'. */
if (vStringChar (name, i++) != '.') {
if (vStringLength (name) < 1 || vStringChar (name, i++) != '.') {
return FALSE;
}
while (i < vStringLength (name)) {
Expand Down

0 comments on commit 04c721c

Please sign in to comment.