Skip to content

Commit

Permalink
ecryptfs: re-order a condition for static checkers
Browse files Browse the repository at this point in the history
Static checkers complain that we are using "s->i" as an offset before
we check whether it is within bounds.  It doesn't matter much but we
can easily swap the order of the checks to make everyone happy.

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Tyler Hicks <[email protected]>
  • Loading branch information
Dan Carpenter authored and tyhicks committed Feb 16, 2019
1 parent 0bdf8a8 commit 4b47a8b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/ecryptfs/keystore.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,9 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
"rc = [%d]\n", __func__, rc);
goto out_free_unlock;
}
while (s->decrypted_filename[s->i] != '\0'
&& s->i < s->block_aligned_filename_size)

while (s->i < s->block_aligned_filename_size &&
s->decrypted_filename[s->i] != '\0')
s->i++;
if (s->i == s->block_aligned_filename_size) {
printk(KERN_WARNING "%s: Invalid tag 70 packet; could not "
Expand Down

0 comments on commit 4b47a8b

Please sign in to comment.