Skip to content

Commit

Permalink
Minor edge case found by Coverity.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjsaunders committed Oct 15, 2014
1 parent 5503fbd commit 9d3b739
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/stash.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ static int sym_cmp(struct stash *s1, struct stash *s2) {
}

/* Special case (unlikely, but possible) */
if (namelen == 1 &&
c1 == '\0') {
return 0;
if (namelen == 1) {
if (c1 == '\0' ||
c2 == '\0') {
return 0;
}
}
}

Expand Down

0 comments on commit 9d3b739

Please sign in to comment.