[misc] fix PVS-Studio warnings

This commit is contained in:
Pete Batard 2022-01-05 12:57:26 +01:00
parent eeca1f279c
commit c28f9bc491
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
26 changed files with 98 additions and 81 deletions

View file

@ -1438,7 +1438,7 @@ static errcode_t xattr_array_update(struct ext2_xattr_handle *h,
return 0;
}
if (h->ibody_count <= old_idx) {
if (old_idx >= 0 && h->ibody_count <= old_idx) {
block_free += EXT2_EXT_ATTR_LEN(name_len);
if (!h->attrs[old_idx].ea_ino)
block_free +=